retryRequestWhenError method

  1. @override
  2. @protected
FutureOr<bool> retryRequestWhenError(
  1. Object object,
  2. StackTrace stackTrace,
  3. int retryCount
)
override

This is used to determine whether a request should be retried when an error is thrown

Implementation

@override
@protected
FutureOr<bool> retryRequestWhenError(
  Object object,
  StackTrace stackTrace,
  int retryCount,
) {
  final whenError = this.whenError;
  if (whenError != null) {
    return whenError(object, stackTrace, retryCount);
  }
  return super.retryRequestWhenError(object, stackTrace, retryCount);
}