Function autopush_common::sentry::event_from_error

source ·
pub fn event_from_error(reportable_err: &dyn ReportableError) -> Event<'static>
Expand description

Custom sentry::event_from_error for ReportableError

std::error::Error doesn’t support backtraces, thus sentry::event_from_error doesn’t either. This function works against ReportableError instead to extract backtraces, etc. from it and its chain of `reportable_source’s.

A caveat of this function is that it cannot extract ReportableErrors/backtraces, etc. that occur in a chain after a std::error::Error occurs: as std::error::Error::source only allows downcasting to a concrete type, not dyn ReportableError.