Skip to content

Commit

Permalink
Merge pull request #134 from rleungx/report-parse-errors-to-stderr
Browse files Browse the repository at this point in the history
report parse errors to stderr
  • Loading branch information
garious authored Apr 19, 2018
2 parents 64e2f1b + b91f6bc commit 43e6741
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/bin/client-demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand All @@ -27,7 +28,10 @@ fn main() {
let args: Vec<String> = 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") {
Expand Down
6 changes: 5 additions & 1 deletion src/bin/testnode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand All @@ -22,7 +23,10 @@ fn main() {
let args: Vec<String> = 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");
Expand Down

0 comments on commit 43e6741

Please sign in to comment.