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
FutureOr<R> onError(
final Object error,
final StackTrace stackTrace,
final A arg,
) {
Error.throwWithStackTrace(error, stackTrace);
}