pub struct CrashHandler<'a> { /* private fields */ }
Expand description
Captures process crashes and reports them to Sentry.
Internally, this uses the Breakpad client to capture crash signals and create minidumps. If no DSN is configured, the crash handler is not initialized.
To send crashes to Sentry, configure a transport
function. Otherwise, the
crash reporter writes crashes to a local database folder, where they can be handled manually.
Implementations§
source§impl<'a> CrashHandler<'a>
impl<'a> CrashHandler<'a>
sourcepub fn new(dsn: &'a str, database: &'a Path) -> Self
pub fn new(dsn: &'a str, database: &'a Path) -> Self
Creates a new crash handler.
Panics if there is are non UTF-8 characters in the path.
sourcepub fn transport(&mut self, transport: Transport) -> &mut Self
pub fn transport(&mut self, transport: Transport) -> &mut Self
Set a transport function that sends data to Sentry.
Instead of using the disabled built-in transport, the crash reporter uses this function to send envelopes to Sentry. Without this function, envelopes will not be sent and remain in the crash database folder for manual retrieval.
sourcepub fn release(&mut self, release: Option<&'a str>) -> &mut Self
pub fn release(&mut self, release: Option<&'a str>) -> &mut Self
Set the crash handler’s Sentry release.
Defaults to no release.
sourcepub fn environment(&mut self, environment: Option<&'a str>) -> &mut Self
pub fn environment(&mut self, environment: Option<&'a str>) -> &mut Self
Set the crash handler’s Sentry environment.
Defaults to no environment