reportCheckedError static method
Report checked error (error caught in try-catch block). Catcher 2 will treat this as normal exception and pass it to handlers.
Implementation
static void reportCheckedError(
error,
stackTrace, {
Map<String, dynamic>? extraData,
}) {
dynamic errorValue = error;
dynamic stackTraceValue = stackTrace;
errorValue ??= 'undefined error';
stackTraceValue ??= StackTrace.current;
_instance._reportError(errorValue, stackTraceValue, extraData: extraData);
}