Skip to content

Commit

Permalink
Verbose error output
Browse files Browse the repository at this point in the history
  • Loading branch information
Stridsvagn69420 committed Dec 4, 2022
1 parent b79cfa3 commit 420fe0d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/bin/cyrkensia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,16 @@ async fn server(cfg: Config) -> io::Result<()> {
let bindaddr = cfg.bindaddr.clone();
let unbound_server = HttpServer::new(move || {
// Initialize state
let Ok(state) = CyrkensiaState::new(cfg.clone()) else {
eprintln!("Cyrkensia failed trying to initialize!");
exit(1);
let state = match CyrkensiaState::new(cfg.clone()) {
Ok(val) => val,
Err(err) => {
let red: &str = Colors::RedBright.as_ref();
eprintln!(
"{red}{}\x1b[0m\n{err}",
timelog!("Cyrkensia failed trying to initialize:")
);
exit(1);
}
};

// ---- App ----
Expand Down

0 comments on commit 420fe0d

Please sign in to comment.