willRetry static method

bool willRetry(
  1. DioException error
)

Whether an installed retry interceptor will handle error.

Connectivity diagnostics use this before forwarding an error so they do not race a retry by marking its origin unavailable. Exact-origin availability remains a separate decision in onError.

Implementation

static bool willRetry(DioException error) {
  return error.requestOptions.extra[_retryInterceptorKey] == true &&
      canRetry(error);
}