diff --git a/src/main.rs b/src/main.rs index c729ca1..24fcd5d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -78,8 +78,20 @@ async fn rocket() -> _ { let rocket = rocket::build(); - let config: Config = rocket.figment().extract().unwrap(); - let ctx = Context::init(config).unwrap(); + let config: Config = match rocket.figment().extract() { + Ok(c) => c, + Err(e) => { + error!("Could not load configuration: {}", e); + std::process::exit(1); + }, + }; + let ctx = match Context::init(config) { + Ok(c) => c, + Err(e) => { + error!("Could not initialize application context: {}", e); + std::process::exit(1); + }, + }; rocket .manage(ctx)