Intercepts errors when added programatically to a
Future constructors invoke this function when the error is received
directly, for example with
Future.error, or when the error is caught
synchronously, for example with
null if no replacement is desired. Otherwise returns an instance
of AsyncError holding the new pair of error and stack trace.
Custom zones may intercept this operation.
Implementations of a new asynchronous primitive that converts synchronous errors to asynchronous errors rarely need to invoke errorCallback, since errors are usually reported through future completers or stream controllers.
AsyncError errorCallback(Object error, StackTrace stackTrace);