Skip to content

Commit

Permalink
Update validate (#180)
Browse files Browse the repository at this point in the history
* still continue to run even if validate failed

* return err if failed
  • Loading branch information
xlc authored May 15, 2024
1 parent 5ea108b commit 95efb2c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand Down

0 comments on commit 95efb2c

Please sign in to comment.