Skip to content

Commit

Permalink
Merge pull request #116 from kralverde/panic-prop
Browse files Browse the repository at this point in the history
kill the program if the main thread panics
  • Loading branch information
Snowiiii authored Oct 14, 2024
2 parents 3ca472c + c9d3e83 commit 68b0a49
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pumpkin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ fn main() -> io::Result<()> {
// ensure rayon is built outside of tokio scope
rayon::ThreadPoolBuilder::new().build_global().unwrap();
rt.block_on(async {
let default_panic = std::panic::take_hook();
std::panic::set_hook(Box::new(move |info| {
default_panic(info);
// TODO: Gracefully exit?
std::process::exit(1);
}));

const SERVER: Token = Token(0);
use std::time::Instant;

Expand Down

0 comments on commit 68b0a49

Please sign in to comment.