logo
pub fn capture_error<E: Error + ?Sized>(error: &E) -> Uuid
Expand description

Captures a std::error::Error.

Creates an event from the given error and sends it to the current hub. A chain of errors will be resolved as well, and sorted oldest to newest, as described in the sentry event payloads.

Examples

let err = "NaN".parse::<usize>().unwrap_err();

sentry::capture_error(&err);

assert_eq!(captured_event.exception.len(), 1);
assert_eq!(&captured_event.exception[0].ty, "ParseIntError");