onError method
void
onError(
- ErrorType type,
- Object error,
- StackTrace? stackTrace,
- FlutterErrorDetails? flutterErrorDetails,
override
The callback which is called when an error occurs.
Implementation
@override
void onError(
ErrorType type,
Object error,
StackTrace? stackTrace,
FlutterErrorDetails? flutterErrorDetails,
) {
if (kDebugMode) {
if (ErrorType.flutter == type && null != flutterErrorDetails) {
FlutterError.presentError(flutterErrorDetails);
return;
}
debugPrint(
'=================== CAUGHT ${type.toString().split('.').last.toUpperCase()} ERROR',
);
debugPrint(error.toString());
if (null != stackTrace) {
debugPrint(stackTrace.toString());
}
}
}