Class ExceptionHandler (2.43.0)

public final class ExceptionHandler implements ResultRetryAlgorithm<Object>, Serializable

Exception retry algorithm implementation used by RetryHelper.

Inheritance

Object > ExceptionHandler

Implements

com.google.api.gax.retrying.ResultRetryAlgorithm<java.lang.Object>, Serializable

Static Methods

getDefaultInstance()

public static ExceptionHandler getDefaultInstance()

Returns an instance which retry any checked exception and abort on any runtime exception.

Returns
Type Description
ExceptionHandler

newBuilder()

public static ExceptionHandler.Builder newBuilder()
Returns
Type Description
ExceptionHandler.Builder

Methods

createNextAttempt(Throwable prevThrowable, Object prevResponse, TimedAttemptSettings prevSettings)

public TimedAttemptSettings createNextAttempt(Throwable prevThrowable, Object prevResponse, TimedAttemptSettings prevSettings)
Parameters
Name Description
prevThrowable Throwable
prevResponse Object
prevSettings TimedAttemptSettings
Returns
Type Description
TimedAttemptSettings

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

shouldRetry(Throwable prevThrowable, Object prevResponse)

public boolean shouldRetry(Throwable prevThrowable, Object prevResponse)
Parameters
Name Description
prevThrowable Throwable
prevResponse Object
Returns
Type Description
boolean