Capture and print stacktraces for panics
This commit is contained in:
parent
249614d3c0
commit
c01c4c30cd
1 changed files with 7 additions and 1 deletions
|
|
@ -21,7 +21,13 @@ async fn main() {
|
|||
|s| format!("{}:{}:{}", s.file(), s.line(), s.column()),
|
||||
);
|
||||
|
||||
eprintln!(" P! [{:?}] {}: {}", ONSET.elapsed(), location, payload);
|
||||
eprintln!(" P! [{:?}] {location}: {payload}", ONSET.elapsed());
|
||||
|
||||
let trace = std::backtrace::Backtrace::capture();
|
||||
if trace.status() == std::backtrace::BacktraceStatus::Captured {
|
||||
eprintln!("\n Stack trace:\n{trace:#?}");
|
||||
}
|
||||
|
||||
}));
|
||||
|
||||
let app = Router::new()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue