Exception ApiException (2.83.0)

public class ApiException extends RuntimeException

Represents an exception thrown during an RPC call.

Constructors

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

public ApiException(@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

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

public ApiException(@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

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

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

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

public ApiException(@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

Methods

getDomain()

public @Nullable String getDomain()

Returns the logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. e.g. googleapis.com

Returns
Type Description
@org.jspecify.annotations.Nullable java.lang.String

getErrorDetails()

public ErrorDetails getErrorDetails()

Returns all standard error messages that server sends.

Returns
Type Description
ErrorDetails

getMetadata()

public @Nullable Map<String,String> getMetadata()

Returns additional structured details about this exception.

Returns
Type Description
@org.jspecify.annotations.Nullable java.util.Map<String,String>

getReason()

public @Nullable String getReason()

Returns the reason of the exception. This is a constant value that identifies the proximate cause of the error. e.g. SERVICE_DISABLED

Returns
Type Description
@org.jspecify.annotations.Nullable java.lang.String

getStatusCode()

public StatusCode getStatusCode()

Returns the status code of the underlying exception.

Returns
Type Description
StatusCode

isRetryable()

public boolean isRetryable()

Returns whether the failed request can be retried.

Returns
Type Description
boolean