#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

#448 in Debugging

Download history 898/week @ 2023-11-27 1043/week @ 2023-12-04 1045/week @ 2023-12-11 1010/week @ 2023-12-18 374/week @ 2023-12-25 788/week @ 2024-01-01 1112/week @ 2024-01-08 1056/week @ 2024-01-15 1091/week @ 2024-01-22 1224/week @ 2024-01-29 1423/week @ 2024-02-05 1410/week @ 2024-02-12 1218/week @ 2024-02-19 1376/week @ 2024-02-26 1356/week @ 2024-03-04 442/week @ 2024-03-11

4,445 downloads per month
Used in 9 crates (8 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.6–3.5MB
~73K SLoC