From 69ca0b14dc054b50185dc1cfe358749780157138 Mon Sep 17 00:00:00 2001 From: Drew Short Date: Wed, 5 Dec 2018 17:30:12 -0600 Subject: [PATCH] Added some startup safety by not unwrapping actix_server directly --- src/main.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3ba5207..8218716 100644 --- a/src/main.rs +++ b/src/main.rs @@ -111,9 +111,12 @@ fn main() { host, port, workers, config_path ); - actix_web::server::new(|| server::router::create()) + actix_server = actix_web::server::new(|| server::router::create()) .workers(workers) - .bind(format!("{}:{}", host, port)) - .unwrap() - .run(); + .bind(format!("{}:{}", host, port)); + + match actix_server { + Ok(server) => server.run(), + Err(e) => error!("{}", e) + } }