reportCheckedError static method

void reportCheckedError(
  1. dynamic error,
  2. dynamic stackTrace, {
  3. Map<String, dynamic>? extraData,
})

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);
}