main: exit on panic
This commit is contained in:
parent
6ea08de8f0
commit
9682ba2424
|
@ -1,4 +1,5 @@
|
|||
use std::time::Duration;
|
||||
use std::{panic, process};
|
||||
use tokio::time::timeout;
|
||||
|
||||
mod config;
|
||||
|
@ -11,6 +12,13 @@ use worker::Message;
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let orig_hook = panic::take_hook();
|
||||
panic::set_hook(Box::new(move |panic_info| {
|
||||
// invoke the default handler and exit the process
|
||||
orig_hook(panic_info);
|
||||
process::exit(1);
|
||||
}));
|
||||
|
||||
let config = config::Config::load_file(
|
||||
&std::env::args()
|
||||
.skip(1)
|
||||
|
|
Loading…
Reference in New Issue