Skip to content

Commit

Permalink
Improve error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Jun 16, 2018
1 parent 04d1a08 commit 15c7f36
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/bin/client-demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,6 @@ fn converge(
}

fn read_leader(path: String) -> ReplicatedData {
let file = File::open(path).expect("file");
serde_json::from_reader(file).expect("parse")
let file = File::open(path.clone()).expect(&format!("file not found: {}", path));
serde_json::from_reader(file).expect(&format!("failed to parse {}", path))
}
12 changes: 9 additions & 3 deletions src/bin/fullnode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,20 @@ fn main() {
if let Ok(data) = serde_json::from_reader(file) {
repl_data = data;
} else {
warn!("failed to parse leader {}, generating new identity", path);
warn!("failed to parse {}, generating new identity", path);
}
} else {
warn!("failed to read {}, generating new identity", path);
}
}

let threads = if matches.opt_present("v") {
eprintln!("starting validator... {}", repl_data.requests_addr);
let path = matches.opt_str("v").unwrap();
let file = File::open(path).expect("file");
eprintln!(
"starting validator... {} using {}",
repl_data.requests_addr, path
);
let file = File::open(path.clone()).expect(&format!("file not found: {}", path));
let leader = serde_json::from_reader(file).expect("parse");
let s = Server::new_validator(
bank,
Expand Down

0 comments on commit 15c7f36

Please sign in to comment.