reportError method
Future<void>
reportError(
- dynamic ex, {
- StackTrace? stack,
- String? message,
- String? library,
- InformationCollector? informationCollector,
Report the error in an isolate or in a run zone.
Implementation
Future<void> reportError(
dynamic ex, {
StackTrace? stack,
String? message,
String? library,
InformationCollector? informationCollector,
}) async {
//
message ??= 'while attempting to run your app';
library ??= 'Your app';
// Log on the console
_logErrorHandlerError(
ErrorSummary(message),
ex,
stack: stack,
library: library,
informationCollector: informationCollector,
);
try {
// Designated Reporting feature
await _errorReport?.call(ex, stack ?? StackTrace.empty);
} catch (e, stack) {
// Log on the console
_logErrorHandlerError(
ErrorSummary("Error in 'errorReport'"),
e,
stack: stack,
);
}
}