A crate to make debugging unexpected panics easier both on developer and consumer machines. Provides a panic handler which generates a helpful panic message and saves a backtrace, system information and minidump to a file.
colored_panic_message
.Exit
, Abort
, Loop
.``` use std::panic;
fn main() { panic::sethook(Box::new(|panicinfo: &panic::PanicInfo| { let panichandlingconfig = oopsie-woopsie::PanicHandlingConfig { terminationmethod: "exit".tostring(), // The method used to terminate the program. Possible values: "Exit", "Abort", "Loop" terminationexitcode: Some(101), // The returned error code when termination method "Exit" is used. Defaults to exit code 101. panicinfologfiledestination: "C:/some/path/panic.txt".tostring(), // The path where to place the panic info log file. minidumpfiledestination: "C:/some/path/panic.mdmp".to_string(), // The path where to place the minidump file. };
// Replaces the default panic handler with the custom made one.
oopsie-woopsie::handle_error(
panicinfo,
panic_handling_config,
Some(std::backtrace::Backtrace::force_capture()),
);
}));
} ```