reportCheckedError static method

void reportCheckedError(
  1. dynamic error,
  2. dynamic stackTrace
)

Report checked error (error caught in try-catch block). Catcher will treat this as normal exception and pass it to handlers.

Implementation

static void reportCheckedError(dynamic error, dynamic stackTrace) {
  dynamic errorValue = error;
  dynamic stackTraceValue = stackTrace;
  errorValue ??= "undefined error";
  stackTraceValue ??= StackTrace.current;
  _instance._reportError(error, stackTrace);
}