onError property

StreamOnErrorListener? onError
final

On errors from this stream, the onError handler is called with the error object and possibly a stack trace.

The onError callback must be of type void onError(error) or void onError(error, StackTrace stackTrace). If onError accepts two arguments it is called with the error object and the stack trace (which could be null if this stream itself received an error without stack trace). Otherwise it is called with just the error object. If onError is omitted, any errors on this stream are considered unhandled, and will be passed to the current Zone's error handler. By default unhandled async errors are treated as if they were uncaught top-level errors.

Implementation

final StreamOnErrorListener? onError;