Using except rather than unwrap during client init

This commit is contained in:
Jedrzej Stuczynski
2020-01-31 10:04:10 +00:00
parent bb29421854
commit 09ac19fb45
+6 -2
View File
@@ -18,11 +18,15 @@ pub fn execute(matches: &ArgMatches) {
let pathfinder = ClientPathfinder::new_from_config(&config);
let pem_store = PemStore::new(pathfinder);
pem_store.write_identity(mix_identity_keys).unwrap();
pem_store
.write_identity(mix_identity_keys)
.expect("Failed to save identity keys");
println!("Saved mixnet identity keypair");
let config_save_location = config.get_config_file_save_location();
config.save_to_file(None).unwrap();
config
.save_to_file(None)
.expect("Failed to save the config file");
println!("Saved configuration file to {:?}", config_save_location);
println!("Client configuration completed.\n\n\n")
}