Merge pull request #2579 from blockstack/feat/unmask-panic-msg

Feature: stacks-node panic handler to print abort messages
This commit is contained in:
Aaron Blankstein
2021-04-07 13:06:33 -05:00
committed by GitHub

View File

@@ -52,8 +52,12 @@ use std::process;
use backtrace::Backtrace;
fn main() {
panic::set_hook(Box::new(|_| {
eprintln!("Process abort due to thread panic");
panic::set_hook(Box::new(|panic_info| {
if let Some(s) = panic_info.payload().downcast_ref::<&str>() {
eprintln!("Process abort due to thread panic: {:?}", s);
} else {
eprintln!("Process abort due to thread panic");
}
let bt = Backtrace::new();
eprintln!("{:?}", &bt);