Crates.io | stable-eyre |
lib.rs | stable-eyre |
version | 0.2.2 |
source | src |
created_at | 2020-05-03 19:47:37.145027 |
updated_at | 2021-02-02 21:12:14.180216 |
description | A custom context for eyre that supports capturing Backtraces on stable |
homepage | https://github.com/yaahc/stable-eyre |
repository | https://github.com/yaahc/stable-eyre |
max_upload_size | |
id | 237208 |
size | 16,463 |
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.
Add the following to your toml file:
[dependencies]
stable-eyre = "0.2"
Then install the hook handler before constructing any eyre::Report
types.
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")
}