Skip to content

auguwu/sentry-eyre

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

54 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ»β€β„οΈπŸ‘€ 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.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);
        }
    }
}

Backtrace support for stable-eyre

[dependencies]
sentry-eyre = { version = "0.2", features = ["stable-backtrace"]
sentry = "*"
eyre = "*"
stable-eyre = "*"
fn main() {
    // enable stable-eyre before any eyre reports are created
    stable_eyre::install().unwrap();

    // rest of your main function
}

License

sentry-eyre is released under the MIT License with love by Noel Towa cutie@floofy.dev

About

πŸ»β€β„οΈπŸ‘€ Sentry integration for `eyre`

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

  •  

Contributors 3

  •  
  •  
  •  

Languages