#sentry #integration #eyre #capture #🐻‍❄️👀

sentry-eyre

🐻‍❄️👀 Sentry integration for eyre

1 unstable release

0.1.0 Aug 16, 2023

#10 in #eyre

Download history 18/week @ 2024-01-22 110/week @ 2024-01-29 20/week @ 2024-02-05 23/week @ 2024-02-19 48/week @ 2024-02-26 82/week @ 2024-03-04 89/week @ 2024-03-11 79/week @ 2024-03-18 146/week @ 2024-03-25 80/week @ 2024-04-01 54/week @ 2024-04-08 29/week @ 2024-04-15 37/week @ 2024-04-22

204 downloads per month

MIT license

10KB

🐻‍❄️👀 sentry-eyre

Sentry integration for eyre

sentry-eyre is a integration to capture eyre::Reports. This crate was inspired by the sentry-anyhow integration, and does a similar API but distinct enough to not create any issues.

Usage

[dependencies]
sentry-eyre = "0.1"
sentry = "*"
use eyre::Result;
use sentry_eyre::capture_report;
use sentry::{ClientOptions, init, types::Dsn};
use std::io::{Error, ErrorKind};

fn some_method_that_fails() -> Result<()> {
    Err(Error::new(ErrorKind::Other, "this should fail"))
}

fn main() {
    // init the client guard, which will be dropped at the end
    // of the scope.
    let _guard = init(ClientOptions::default());
    let func = some_method_that_fails();

    match func {
        Ok(()) => panic!("expected this to fail")
        Err(report) => {
            capture_report(&report);
        }
    }
}

License

sentry-eyre is released under the MIT License with love by Noel.

Dependencies

~3.5–6MB
~145K SLoC