scoped-panic-hook 0.1.0

Adds scoped, nestable, thread-local hooks for panics and some utilities for capturing and analyzing panics more conveniently
Documentation
  • Coverage
  • 88.89%
    24 out of 27 items documented1 out of 19 items with examples
  • Size
  • Source code size: 21.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.57 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • target-san/scoped-panic-hook
    1 1 2
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • target-san
scoped-panic-hook-0.1.0 has been yanked.

Convenient panic catcher and scoped panic hooks infrastructure

This crate provides convenient API for obtaining panic info after unwinding

    let result = catch_panic(|| {
        panic!("Something bad happened!");
    });

    if let Err(panic) = result {
        eprintln!("{}", panic.display_with_backtrace());
    }

This will either produce normal result of closure or or conveniently gathered panic info, which includes panic location, message, raw payload and backtrace

Useful modules

  • hook - raw scoped hook APIs
  • panic - all types and functions relevant to capturing panics, including some advanced features

Development

Project uses cargo-xtask pattern. Run cargo xtask to see available commands

TODO

Test no-unwind cases