Module panic_handler

Source
Expand description

Used to capture the backtrace from panic and store it in a task_local, so that it can be retrieved later when the panic is catched.

Functionsยง

set_panic_hook
Call this from the main method of your application, and use it in conjunction with [with_backtrace_tracking] and [take_panic_backtrace], in order to capture the backtrace from a panic.
take_panic_backtrace
Take the backtrace from the task_local variable, and reset the task_local to None. Return error if the backtrace is not stored, or cannot be retrieved.
with_backtrace_tracking
Set a task_local variable for this future f, so any panic occurred in f can be stored and retrieved later.