fixed stderr (#1812)

This commit is contained in:
0rphon 2022-05-12 14:28:19 -07:00 committed by GitHub
parent 4d377b37f6
commit d811f62559
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -180,27 +180,27 @@ fn set_panic_hook() {
#[cfg(not(debug_assertions))]
std::panic::set_hook({
Box::new(move |e| {
println!(
eprintln!(
"thread `{}` {}",
std::thread::current().name().unwrap_or("<unnamed>"),
e
);
println!("stack backtrace: \n{:?}", backtrace::Backtrace::new());
println!("error: internal compiler error: unexpected panic\n");
println!("note: the compiler unexpectedly panicked. this is a bug.\n");
println!("note: we would appreciate a bug report: https://github.com/AleoHQ/leo/issues/new?labels=bug,panic&template=bug.md&title=[Bug]\n");
println!(
eprintln!("stack backtrace: \n{:?}", backtrace::Backtrace::new());
eprintln!("error: internal compiler error: unexpected panic\n");
eprintln!("note: the compiler unexpectedly panicked. this is a bug.\n");
eprintln!("note: we would appreciate a bug report: https://github.com/AleoHQ/leo/issues/new?labels=bug,panic&template=bug.md&title=[Bug]\n");
eprintln!(
"note: {} {} running on {} {}\n",
env!("CARGO_PKG_NAME"),
env!("CARGO_PKG_VERSION"),
sys_info::os_type().unwrap_or_else(|e| e.to_string()),
sys_info::os_release().unwrap_or_else(|e| e.to_string()),
);
println!(
eprintln!(
"note: compiler args: {}\n",
std::env::args().collect::<Vec<_>>().join(" ")
);
println!("note: compiler flags: {:?}\n", Opt::from_args());
eprintln!("note: compiler flags: {:?}\n", Opt::from_args());
})
});
}