Exception ApiException (2.9.0)

publicclassApiExceptionextendsRuntimeException

Represents an exception thrown during an RPC call.

Constructors

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

publicApiException(Stringmessage,Throwablecause,StatusCodestatusCode,booleanretryable)
Parameters
NameDescription
messageString
causeThrowable
statusCodeStatusCode
retryableboolean

ApiException(Throwable cause, StatusCode statusCode, boolean retryable)

publicApiException(Throwablecause,StatusCodestatusCode,booleanretryable)
Parameters
NameDescription
causeThrowable
statusCodeStatusCode
retryableboolean

Methods

getStatusCode()

publicStatusCodegetStatusCode()

Returns the status code of the underlying exception.

Returns
TypeDescription
StatusCode

isRetryable()

publicbooleanisRetryable()

Returns whether the failed request can be retried.

Returns
TypeDescription
boolean

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-17 UTC.