Crates.io | sentry-eyre |
lib.rs | sentry-eyre |
version | 0.2.0 |
source | src |
created_at | 2023-08-16 07:47:58.175045 |
updated_at | 2024-10-15 02:15:28.681903 |
description | 🐻❄️👀 Sentry integration for `eyre` |
homepage | |
repository | https://github.com/auguwu/sentry-eyre |
max_upload_size | |
id | 945607 |
size | 27,415 |
Sentry integration for
eyre
sentry-eyre is a integration to capture eyre::Report
s. This crate was inspired by the sentry-anyhow
integration, and does a similar API but distinct enough to not create any issues.
[dependencies]
sentry-eyre = "0.2"
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);
}
}
}
sentry-eyre is released under the MIT License with love by Noel Towa cutie@floofy.dev