onError method
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);
}