handleUncaughtError abstract method

R handleUncaughtError<R>(error, StackTrace stackTrace)

Handles uncaught asynchronous errors.

There are two kind of asynchronous errors that are handled by this function:

  1. Uncaught errors that were thrown in asynchronous callbacks, for example, a throw in the function passed to Timer.run.
  2. Asynchronous errors that are pushed through Future and Stream chains, but for which no child registered an error handler. Most asynchronous classes, like Future or Stream push errors to their listeners. Errors are propagated this way until either a listener handles the error (for example with Future.catchError), or no listener is available anymore. In the latter case, futures and streams invoke the zone's handleUncaughtError.

By default, when handled by the root zone, uncaught asynchronous errors are treated like uncaught synchronous exceptions.

Source

R handleUncaughtError<R>(error, StackTrace stackTrace);

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-async/Zone/handleUncaughtError.html