handle method

void handle(
  1. Function errorHandler
)

Calls an error handler with the error and stacktrace.

An async error handler function is either a function expecting two arguments, which will be called with the error and the stack trace, or it has to be a function expecting only one argument, which will be called with only the error.

Implementation

void handle(Function errorHandler) {
  if (errorHandler is ZoneBinaryCallback) {
    errorHandler(error, stackTrace);
  } else {
    (errorHandler as ZoneUnaryCallback)(error);
  }
}