mirror of
https://github.com/denoland/deno.git
synced 2025-01-18 03:44:05 -05:00
Better output on panic (#1129)
This commit is contained in:
parent
162eeca373
commit
21dac66465
1 changed files with 1 additions and 5 deletions
|
@ -66,11 +66,7 @@ fn main() {
|
||||||
// https://github.com/rust-lang/cargo/issues/2738
|
// https://github.com/rust-lang/cargo/issues/2738
|
||||||
// Therefore this hack.
|
// Therefore this hack.
|
||||||
std::panic::set_hook(Box::new(|panic_info| {
|
std::panic::set_hook(Box::new(|panic_info| {
|
||||||
if let Some(location) = panic_info.location() {
|
eprintln!("{}", panic_info.to_string());
|
||||||
eprintln!("PANIC file '{}' line {}", location.file(), location.line());
|
|
||||||
} else {
|
|
||||||
eprintln!("PANIC occurred but can't get location information...");
|
|
||||||
}
|
|
||||||
std::process::abort();
|
std::process::abort();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue