onError method

  1. @override
FutureOr<R> onError(
  1. Object error,
  2. StackTrace stackTrace,
  3. A arg
)
override

Hook method that is called if the next handler throws.

If it returns a value, this handler completes normally with that value. Otherwise the exception propagates to the caller.

Implementation

@override
FutureOr<R> onError(
  final Object error,
  final StackTrace stackTrace,
  final A arg,
) {
  if (_onError != null) {
    return _onError.call(error, stackTrace, arg);
  }
  Error.throwWithStackTrace(error, stackTrace);
}