From 95efb2c7b11b21ea86ac97bba9b2451fb4755c42 Mon Sep 17 00:00:00 2001 From: Xiliang Chen Date: Wed, 15 May 2024 21:04:55 +1200 Subject: [PATCH] Update validate (#180) * still continue to run even if validate failed * return err if failed --- src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9eed3b5..5eceb07 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,10 +4,14 @@ async fn main() -> anyhow::Result<()> { let cli = subway::cli::parse_args(); let config = subway::config::read_config(&cli.config)?; tracing::trace!("{:#?}", config); - subway::config::validate(&config).await?; + + let validate_res = subway::config::validate(&config).await; + if let Err(err) = &validate_res { + tracing::error!("Config validation failed: {err:?}"); + } // early return if we're just validating the config if cli.is_validate() { - return Ok(()); + return validate_res; } let subway_server = subway::server::build(config).await?;