#stable #backtrace #eyre #context #capturing #report #hook

stable-eyre

A custom context for eyre that supports capturing Backtraces on stable

7 releases

0.2.2 Feb 2, 2021
0.2.1 Aug 5, 2020
0.2.0 Jul 13, 2020
0.1.3 May 3, 2020

#519 in Debugging

Download history 2422/week @ 2024-07-28 2424/week @ 2024-08-04 1766/week @ 2024-08-11 1812/week @ 2024-08-18 2579/week @ 2024-08-25 1797/week @ 2024-09-01 2295/week @ 2024-09-08 1617/week @ 2024-09-15 1784/week @ 2024-09-22 1935/week @ 2024-09-29 2021/week @ 2024-10-06 2148/week @ 2024-10-13 2657/week @ 2024-10-20 2197/week @ 2024-10-27 2189/week @ 2024-11-03 2231/week @ 2024-11-10

9,388 downloads per month
Used in 16 crates (14 directly)

MIT/Apache

12KB
112 lines

stable-eyre

Build Status Latest Version Rust Documentation

This library provides a custom eyre::EyreHandler type for usage with eyre that provides all the same features as eyre::DefaultHandler except it works on stable by capturing a backtrace::Backtrace via backtrace-rs.

Setup

Add the following to your toml file:

[dependencies]
stable-eyre = "0.2"

Then install the hook handler before constructing any eyre::Report types.

Example

use stable_eyre::eyre::{eyre, Report, WrapErr};

fn main() -> Result<(), Report> {
    stable_eyre::install()?;

    let e: Report = eyre!("oh no this program is just bad!");

    Err(e).wrap_err("usage example successfully experienced a failure")
}

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~2.5–7.5MB
~69K SLoC