Exception ApiException (2.41.0)

public class ApiException extends RuntimeException

Represents an exception thrown during an RPC call.

Constructors

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

public ApiException(String message, Throwable cause, StatusCode statusCode, boolean retryable)
Parameters
NameDescription
messageString
causeThrowable
statusCodeStatusCode
retryableboolean

ApiException(Throwable cause, StatusCode statusCode, boolean retryable)

public ApiException(Throwable cause, StatusCode statusCode, boolean retryable)
Parameters
NameDescription
causeThrowable
statusCodeStatusCode
retryableboolean

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

public ApiException(Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails)
Parameters
NameDescription
causeThrowable
statusCodeStatusCode
retryableboolean
errorDetailsErrorDetails

Methods

getDomain()

public 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
TypeDescription
String

getErrorDetails()

public ErrorDetails getErrorDetails()

Returns all standard error messages that server sends.

Returns
TypeDescription
ErrorDetails

getMetadata()

public Map<String,String> getMetadata()

Returns additional structured details about this exception.

Returns
TypeDescription
Map<String,String>

getReason()

public 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
TypeDescription
String

getStatusCode()

public StatusCode getStatusCode()

Returns the status code of the underlying exception.

Returns
TypeDescription
StatusCode

isRetryable()

public boolean isRetryable()

Returns whether the failed request can be retried.

Returns
TypeDescription
boolean