Skip to content

Commit

Permalink
Remove custom panic handler.
Browse files Browse the repository at this point in the history
This was introduced because Tokio would swallow panics. This is still
the case, but this panic handler causes more problems than it solves.
It requires people to know how to use debuggers to inspect stacktraces.

TODO:
- Fix Tokio to not swallow errors.
- Be vigilant in the intrim to not introduce broken tests due to this
  unfortunate "feature" of tokio.
  • Loading branch information
ry committed Dec 11, 2018
1 parent 81c8926 commit a8c3b44
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/main.rs
Expand Up @@ -77,14 +77,6 @@ fn print_err_and_exit(err: js_errors::JSError) {
}

fn main() {
// Rust does not die on panic by default. And -Cpanic=abort is broken.
// https://github.com/rust-lang/cargo/issues/2738
// Therefore this hack.
std::panic::set_hook(Box::new(|panic_info| {
eprintln!("{}", panic_info.to_string());
std::process::abort();
}));

log::set_logger(&LOGGER).unwrap();
let args = env::args().collect();
let (flags, rest_argv, usage_string) =
Expand Down

0 comments on commit a8c3b44

Please sign in to comment.