X - The type of exception you are checking and could possibly return.@FunctionalInterface public interface RetryDeterminer<X extends Exception>
ResilientOperation.| Modifier and Type | Field and Description |
|---|---|
static RetryDeterminer<Exception> |
ALL_ERRORS
Always retries.
|
static RetryDeterminer<Exception> |
DEFAULT
Retries exception when either
SOCKET_ERRORS or SERVER_ERRORS would retry. |
static RetryDeterminer<IOException> |
RATE_LIMIT_ERRORS
A rate limited determiner that uses a default
ApiErrorExtractor. |
static RetryDeterminer<IOException> |
SERVER_ERRORS
Server errors RetryDeterminer decides to retry on HttpResponseExceptions that return a 500.
|
static RetryDeterminer<IOException> |
SOCKET_ERRORS
Socket errors retry determiner retries on socket exceptions.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
shouldRetry(X e)
Determines if we should attempt a retry depending on the caught exception.
|
static final RetryDeterminer<Exception> DEFAULT
SOCKET_ERRORS or SERVER_ERRORS would retry.static final RetryDeterminer<Exception> ALL_ERRORS
static final RetryDeterminer<IOException> SOCKET_ERRORS
static final RetryDeterminer<IOException> SERVER_ERRORS
static final RetryDeterminer<IOException> RATE_LIMIT_ERRORS
ApiErrorExtractor.boolean shouldRetry(X e)
To indicate that no retry should be made, return false. If no retry, the exception should be returned to the user.
e - Exception of type X that can be examined to determine if a retry is possible.Copyright © 2024. All rights reserved.