Crash Events
Send app crash event data into Fullstory
Crash events are captured when Flutter reports an error in either the widget build phase or more generally in the Dart runtime. Fullstory supports autocapture of both types, while passing the error on to your other crash reporting tools.
Autocapture
Crash autocapture is configured with FS.captureErrors()
. The function will
call any other error handlers you have previously configured after capturing
the crash. You may also set an additional errorHandler
that is called last for
any additional cleanup you may want to do.
After a crash is captured, Fullstory automatically shuts down.
Parameters
An optional function invoked with crash details once Fullstory has captured the crash.
Manual capture
This API allows manual reporting of crash events if you do not want to use
captureErrors
. A call to this API will still halt Fullstory capture,
since we assume all reported errors to crashEvent
are fatal.
Parameters
A descriptive name for the crash. Defaults to "Flutter crash".
The exception object causing the crash.
The stack trace of the crashing exception
FS.captureErrors({
void Function(Object?, StackTrace?) errorHandler,
})
FS.crashEvent({
String name,
Object? exception,
StackTrace stackTrace,
})
Example Invocation
Configuring autocapture
FS.captureErrors(
errorHandler: (e, _) => notifyUserAndShutDown(e),
);
Manually reporting a fatal exception
try {
/* Critical app logic here. */
} on FatalException catch(e, stack) {
FS.crashEvent(exception: e, stackTrace: stack);
}