onError<R> method

  1. @protected
  2. @visibleForTesting
FutureOr<R?> onError<R>(
  1. DataException e
)
inherited

Implements global request error handling.

Defaults to throw e unless it is an HTTP 404 or an OfflineException.

NOTE: onError arguments throughout the API are used to override this default behavior.

Implementation

@protected
@visibleForTesting
FutureOr<R?> onError<R>(DataException e) {
  if (e.statusCode == 404 || e is OfflineException) {
    return null;
  }
  throw e;
}