diff --git a/src/bin/client-demo.rs b/src/bin/client-demo.rs index 0829c15e2f3a2e..50b2dd064029f3 100644 --- a/src/bin/client-demo.rs +++ b/src/bin/client-demo.rs @@ -12,6 +12,7 @@ use solana::transaction::Transaction; use std::env; use std::io::stdin; use std::net::UdpSocket; +use std::process::exit; use std::thread::sleep; use std::time::{Duration, Instant}; @@ -27,7 +28,10 @@ fn main() { let args: Vec = env::args().collect(); let matches = match opts.parse(&args[1..]) { Ok(m) => m, - Err(f) => panic!(f.to_string()), + Err(e) => { + eprintln!("{}", e); + exit(1); + } }; if matches.opt_present("s") { diff --git a/src/bin/testnode.rs b/src/bin/testnode.rs index 3e0ac842664e0c..068a4c839ba53f 100644 --- a/src/bin/testnode.rs +++ b/src/bin/testnode.rs @@ -11,6 +11,7 @@ use solana::event::Event; use solana::historian::Historian; use std::env; use std::io::{self, stdout, BufRead}; +use std::process::exit; use std::sync::atomic::AtomicBool; use std::sync::{Arc, Mutex}; @@ -22,7 +23,10 @@ fn main() { let args: Vec = env::args().collect(); let matches = match opts.parse(&args[1..]) { Ok(m) => m, - Err(f) => panic!(f.to_string()), + Err(e) => { + eprintln!("{}", e); + exit(1); + } }; if matches.opt_present("p") { port = matches.opt_str("p").unwrap().parse().expect("port");