1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

Better output on panic (#1129)

This commit is contained in:
Joseph 2018-10-31 17:30:52 +03:00 committed by Ryan Dahl
parent 162eeca373
commit 21dac66465

View file

@ -66,11 +66,7 @@ fn main() {
// https://github.com/rust-lang/cargo/issues/2738
// Therefore this hack.
std::panic::set_hook(Box::new(|panic_info| {
if let Some(location) = panic_info.location() {
eprintln!("PANIC file '{}' line {}", location.file(), location.line());
} else {
eprintln!("PANIC occurred but can't get location information...");
}
eprintln!("{}", panic_info.to_string());
std::process::abort();
}));