Class ApiExceptionFactory (2.83.0)

public class ApiExceptionFactory

A factory class that returns the corresponding type of exception class from the given status code.

Inheritance

java.lang.Object > ApiExceptionFactory

Static Methods

createException(@Nullable String message, @Nullable Throwable cause, StatusCode statusCode, boolean retryable)

public static ApiException createException(@Nullable String message, @Nullable Throwable cause, StatusCode statusCode, boolean retryable)
Parameters
Name Description
message @org.jspecify.annotations.Nullable java.lang.String
cause @org.jspecify.annotations.Nullable java.lang.Throwable
statusCode StatusCode
retryable boolean
Returns
Type Description
ApiException

createException(@Nullable String message, @Nullable Throwable cause, StatusCode statusCode, boolean retryable, @Nullable ErrorDetails errorDetails)

public static ApiException createException(@Nullable String message, @Nullable Throwable cause, StatusCode statusCode, boolean retryable, @Nullable ErrorDetails errorDetails)
Parameters
Name Description
message @org.jspecify.annotations.Nullable java.lang.String
cause @org.jspecify.annotations.Nullable java.lang.Throwable
statusCode StatusCode
retryable boolean
errorDetails @org.jspecify.annotations.Nullable com.google.api.gax.rpc.ErrorDetails
Returns
Type Description
ApiException

createException(@Nullable Throwable cause, StatusCode statusCode, boolean retryable)

public static ApiException createException(@Nullable Throwable cause, StatusCode statusCode, boolean retryable)
Parameters
Name Description
cause @org.jspecify.annotations.Nullable java.lang.Throwable
statusCode StatusCode
retryable boolean
Returns
Type Description
ApiException

createException(@Nullable Throwable cause, StatusCode statusCode, boolean retryable, @Nullable ErrorDetails errorDetails)

public static ApiException createException(@Nullable Throwable cause, StatusCode statusCode, boolean retryable, @Nullable ErrorDetails errorDetails)
Parameters
Name Description
cause @org.jspecify.annotations.Nullable java.lang.Throwable
statusCode StatusCode
retryable boolean
errorDetails @org.jspecify.annotations.Nullable com.google.api.gax.rpc.ErrorDetails
Returns
Type Description
ApiException