panik 0.2.0

Application-wide panic handling, whereby panics occurring in any thread are treated as a hard error and can be detected by other threads to trigger a graceful exit
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
mod setup;

#[test]
fn main_thread() {
    let result = setup::panik_builder().run_and_handle_panics(|| panic!("oh no"));
    assert!(result.is_none());
    assert!(panik::has_panicked());

    let panics = panik::panics();
    assert_eq!(panics.len(), 1);

    let panic = &panics[0];
    assert_eq!(panic.thread_id(), std::thread::current().id());
    assert_eq!(panic.message(), "oh no");
    assert!(panic.is_backtrace_resolved());
}