From 892ca196f11040d816af347aa774e67785d32bb8 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 15 Nov 2019 10:39:05 -0700 Subject: [PATCH] Improve error message when unable to read a file (#6978) --- genesis/src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/genesis/src/main.rs b/genesis/src/main.rs index ece329fc6a..fac46f0196 100644 --- a/genesis/src/main.rs +++ b/genesis/src/main.rs @@ -33,6 +33,7 @@ pub enum AccountFileFormat { fn pubkey_from_file(key_file: &str) -> Result> { read_pubkey_file(key_file) .or_else(|_| read_keypair_file(key_file).map(|keypair| keypair.pubkey())) + .map_err(|err| format!("Failed to read {}: {}", key_file, err).into()) } fn pubkey_from_str(key_str: &str) -> Result> {