diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 5d139b6..6744157 100644 --- a/src/main.rs +++ b/src/main.rs @@ -118,6 +118,12 @@ async fn main() -> Result<()> { std::env::set_var("RUST_LOG", "main=info,mailrage=info,k2v_client=info") } + // Abort on panic (same behavior as in Go) + std::panic::set_hook(Box::new(|panic_info| { + tracing::error!("{}", panic_info.to_string()); + std::process::abort(); + })); + tracing_subscriber::fmt::init(); let args = Args::parse(); |