stable-eyre

Crates.iostable-eyre
lib.rsstable-eyre
version0.2.2
sourcesrc
created_at2020-05-03 19:47:37.145027
updated_at2021-02-02 21:12:14.180216
descriptionA custom context for eyre that supports capturing Backtraces on stable
homepagehttps://github.com/yaahc/stable-eyre
repositoryhttps://github.com/yaahc/stable-eyre
max_upload_size
id237208
size16,463
eyre (github:eyre-rs:eyre)

documentation

https://docs.rs/stable-eyre

README

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.
Commit count: 7

cargo fmt