pub trait ReportableError: Error {
// Provided methods
fn reportable_source(&self) -> Option<&(dyn ReportableError + 'static)> { ... }
fn backtrace(&self) -> Option<&Backtrace> { ... }
fn is_sentry_event(&self) -> bool { ... }
fn metric_label(&self) -> Option<&'static str> { ... }
fn tags(&self) -> Vec<(&str, String)> { ... }
fn extras(&self) -> Vec<(&str, String)> { ... }
}
Expand description
Interface for reporting our Error types to Sentry or as metrics
Provided Methods§
sourcefn reportable_source(&self) -> Option<&(dyn ReportableError + 'static)>
fn reportable_source(&self) -> Option<&(dyn ReportableError + 'static)>
Like [Error::source] but returns the source (if any) of this error as a ReportableError if it implements the trait. Otherwise callers of this method will likely subsequently call [Error::source] to return the source (if any) as the parent [Error] trait.
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
Return a Backtrace
for this Error if one was captured
sourcefn is_sentry_event(&self) -> bool
fn is_sentry_event(&self) -> bool
Whether this error is reported to Sentry
sourcefn metric_label(&self) -> Option<&'static str>
fn metric_label(&self) -> Option<&'static str>
Errors that don’t emit Sentry events (!is_sentry_event()) emit an increment metric instead with this label
Experimental: return tag key value pairs for metrics and Sentry