mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-06-17 19:05:53 +08:00
Merge pull request #2579 from blockstack/feat/unmask-panic-msg
Feature: stacks-node panic handler to print abort messages
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user