Crate sentry_eyre

Crate sentry_eyre 

Source
Expand description

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

use eyre::Result;
use sentry::{ClientOptions, init, types::Dsn};
use sentry_eyre::capture_report;

fn method_that_might_fail() -> Result<()> {
    Err(eyre::eyre!("this method has failed."))
}

if let Err(e) = method_that_might_fail() {
    capture_report(&e);
}

Traits§

CaptureReportExt
Extension trait to implement a capture_report method on any implementations.

Functions§

capture_report
Captures a Report and sends it to Sentry. Refer to the top-level module documentation on how to use this method.
event_from_report
Utility function to represent a Sentry Event from a Report. This shouldn’t be consumed directly unless you want access to the created Event from a Report.