Macro pretty_panic::pretty_panic [−][src]
macro_rules! pretty_panic {
() => { ... };
($fname : ident) => { ... };
}Expand description
Sets the panic handler function to a function of your choosing. Example:
use pretty_panic::pretty_panic;
use std::panic::PanicInfo;
fn main() {
pretty_panic!(my_panic);
panic!("a panic message")
}
fn my_panic() -> ! {
loop { /* who needs to actually do something when they panic? }
}The panic handler MUST return the never type, or the program will not compile!