doOnError method

Stream<T> doOnError(
  1. void onError(
    1. Object,
    2. StackTrace
    )
)

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(void Function(Object, StackTrace) onError) =>
    DoStreamTransformer<T>(onError: onError).bind(this);