doOnError method

Stream<T> doOnError (
  1. Function onError
)

Invokes the given callback function when the stream emits an error.

Example

Stream.error(Exception())
  .doOnError((error, stacktrace) => print('oh no'))
  .listen(null); // prints 'Oh no'

Implementation

Stream<T> doOnError(Function onError) =>
    transform(DoStreamTransformer<T>(onError: onError));