#eyre #stable #backtrace #context

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
Download history 1045/week @ 2022-08-19 1231/week @ 2022-08-26 1072/week @ 2022-09-02 1171/week @ 2022-09-09 1047/week @ 2022-09-16 1123/week @ 2022-09-23 962/week @ 2022-09-30 1169/week @ 2022-10-07 1350/week @ 2022-10-14 929/week @ 2022-10-21 880/week @ 2022-10-28 1055/week @ 2022-11-04 967/week @ 2022-11-11 1297/week @ 2022-11-18 1053/week @ 2022-11-25 931/week @ 2022-12-02

4,442 downloads per month
Used in fewer than 6 crates

MIT/Apache

10KB
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

~4MB
~81K SLoC