Skip to content

Commit

Permalink
Return error if provided config was missing or invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
banool authored and davidiw committed Oct 27, 2022
1 parent d60b2e4 commit 4f76c9b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions aptos-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

mod log_build_information;

use anyhow::anyhow;
use anyhow::{anyhow, Context};
use aptos_api::bootstrap as bootstrap_api;
use aptos_build_info::build_information;
use aptos_config::{
Expand Down Expand Up @@ -301,9 +301,8 @@ where
fnn.runtime_threads = Some(1);
// If a config path was provided, use that as the template
if let Some(config_path) = config_path {
if let Ok(config) = NodeConfig::load_config(config_path) {
template = config;
}
template = NodeConfig::load_config(&config_path)
.with_context(|| format!("Failed to load config at path: {:?}", config_path))?;
}

template.logger.level = Level::Debug;
Expand Down

0 comments on commit 4f76c9b

Please sign in to comment.