mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2025-01-07 11:32:21 +00:00
Improve CLI error messages
This commit is contained in:
parent
bab1f2b064
commit
39be2ed1d2
@ -366,9 +366,9 @@ impl<'a> ConfigBuilder<'a> {
|
|||||||
///
|
///
|
||||||
/// Returns an error if any files are not found or are invalid.
|
/// Returns an error if any files are not found or are invalid.
|
||||||
pub fn load_client_config(&mut self, path: PathBuf) -> Result<()> {
|
pub fn load_client_config(&mut self, path: PathBuf) -> Result<()> {
|
||||||
self.client_config = read_from_file::<ClientConfig>(path)
|
self.client_config = read_from_file::<ClientConfig>(path.clone())
|
||||||
.map_err(|e| format!("Unable to parse ClientConfig file: {:?}", e))?
|
.map_err(|e| format!("Unable to parse {:?} file: {:?}", path, e))?
|
||||||
.ok_or_else(|| "ClientConfig file does not exist".to_string())?;
|
.ok_or_else(|| format!("{:?} file does not exist", path))?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -377,9 +377,9 @@ impl<'a> ConfigBuilder<'a> {
|
|||||||
///
|
///
|
||||||
/// Returns an error if any files are not found or are invalid.
|
/// Returns an error if any files are not found or are invalid.
|
||||||
pub fn load_eth2_config(&mut self, path: PathBuf) -> Result<()> {
|
pub fn load_eth2_config(&mut self, path: PathBuf) -> Result<()> {
|
||||||
self.eth2_config = read_from_file::<Eth2Config>(path)
|
self.eth2_config = read_from_file::<Eth2Config>(path.clone())
|
||||||
.map_err(|e| format!("Unable to parse Eth2Config file: {:?}", e))?
|
.map_err(|e| format!("Unable to parse {:?} file: {:?}", path, e))?
|
||||||
.ok_or_else(|| "Eth2Config file does not exist".to_string())?;
|
.ok_or_else(|| format!("{:?} file does not exist", path))?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user