From 39be2ed1d24f53b5494e53a89cf00f6b1023dd0f Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Mon, 26 Aug 2019 15:57:40 +1000 Subject: [PATCH] Improve CLI error messages --- beacon_node/src/config.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/beacon_node/src/config.rs b/beacon_node/src/config.rs index 0aa2d29bd..2c928ad44 100644 --- a/beacon_node/src/config.rs +++ b/beacon_node/src/config.rs @@ -366,9 +366,9 @@ impl<'a> ConfigBuilder<'a> { /// /// Returns an error if any files are not found or are invalid. pub fn load_client_config(&mut self, path: PathBuf) -> Result<()> { - self.client_config = read_from_file::(path) - .map_err(|e| format!("Unable to parse ClientConfig file: {:?}", e))? - .ok_or_else(|| "ClientConfig file does not exist".to_string())?; + self.client_config = read_from_file::(path.clone()) + .map_err(|e| format!("Unable to parse {:?} file: {:?}", path, e))? + .ok_or_else(|| format!("{:?} file does not exist", path))?; Ok(()) } @@ -377,9 +377,9 @@ impl<'a> ConfigBuilder<'a> { /// /// Returns an error if any files are not found or are invalid. pub fn load_eth2_config(&mut self, path: PathBuf) -> Result<()> { - self.eth2_config = read_from_file::(path) - .map_err(|e| format!("Unable to parse Eth2Config file: {:?}", e))? - .ok_or_else(|| "Eth2Config file does not exist".to_string())?; + self.eth2_config = read_from_file::(path.clone()) + .map_err(|e| format!("Unable to parse {:?} file: {:?}", path, e))? + .ok_or_else(|| format!("{:?} file does not exist", path))?; Ok(()) }