#error #eyre #report #reporter #context #error-context #handler

simple-eyre

One of the simplest error reporters one can build ontop of eyre, defining only an error report

4 releases (2 breaking)

0.3.1 Jun 24, 2021
0.3.0 Jul 13, 2020
0.2.0 May 18, 2020
0.1.0 Feb 5, 2020

#1094 in Rust patterns

Download history 583/week @ 2024-07-20 1012/week @ 2024-07-27 658/week @ 2024-08-03 611/week @ 2024-08-10 615/week @ 2024-08-17 823/week @ 2024-08-24 686/week @ 2024-08-31 615/week @ 2024-09-07 487/week @ 2024-09-14 426/week @ 2024-09-21 773/week @ 2024-09-28 528/week @ 2024-10-05 577/week @ 2024-10-12 730/week @ 2024-10-19 994/week @ 2024-10-26 928/week @ 2024-11-02

3,322 downloads per month
Used in 6 crates

MIT/Apache

9KB
63 lines

simple-eyre

Latest Version Rust Documentation

This library provides a custom eyre::EyreHandler type for usage with eyre that provides a minimal error report with no additional context. Essentially the minimal implementation of an error reporter.

Setup

Add the following to your toml file:

[dependencies]
simple-eyre = "0.3"

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

Example

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

fn main() -> Result<(), Report> {
    simple_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

~180KB