Catch panics in child threads (#635)

This commit is contained in:
Y0ba 2022-06-05 19:42:15 +00:00 committed by GitHub
parent b8272ae22d
commit 77549d7bbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,13 @@
use av1an_cli::run;
use std::panic;
use std::process;
fn main() -> anyhow::Result<()> {
let orig_hook = panic::take_hook();
// Catch panics in child threads
panic::set_hook(Box::new(move |panic_info| {
orig_hook(panic_info);
process::exit(1);
}));
run()
}