From 12327c868377fe6fe1226ce73713569f5b02965e Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sat, 19 Sep 2020 00:44:16 +0000 Subject: [PATCH] Improve error message when .config/solana/id.json is not found (#12345) (cherry picked from commit 0ed7b0561e34034cdd37ad5fe78cf23db2207b60) Co-authored-by: Michael Vines --- clap-utils/src/keypair.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clap-utils/src/keypair.rs b/clap-utils/src/keypair.rs index ca520a4f7b..1b76bd2337 100644 --- a/clap-utils/src/keypair.rs +++ b/clap-utils/src/keypair.rs @@ -78,7 +78,7 @@ pub fn signer_from_path( KeypairUrl::Filepath(path) => match read_keypair_file(&path) { Err(e) => Err(std::io::Error::new( std::io::ErrorKind::Other, - format!("could not find keypair file: {} error: {}", path, e), + format!("could not read keypair file \"{}\". Run \"solana-keygen new\" to create a keypair file: {}", path, e), ) .into()), Ok(file) => Ok(Box::new(file)), @@ -149,7 +149,7 @@ pub fn resolve_signer_from_path( KeypairUrl::Filepath(path) => match read_keypair_file(&path) { Err(e) => Err(std::io::Error::new( std::io::ErrorKind::Other, - format!("could not find keypair file: {} error: {}", path, e), + format!("could not read keypair file \"{}\". Run \"solana-keygen new\" to create a keypair file: {}", path, e), ) .into()), Ok(_) => Ok(Some(path.to_string())),