Package com.google.api.gax.rpc
Class ApiException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.google.api.gax.rpc.ApiException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AbortedException,AlreadyExistsException,CancelledException,DataLossException,DeadlineExceededException,FailedPreconditionException,InternalException,InvalidArgumentException,NotFoundException,OutOfRangeException,PermissionDeniedException,ResourceExhaustedException,UnauthenticatedException,UnavailableException,UnimplementedException,UnknownException,WatchdogTimeoutException
Represents an exception thrown during an RPC call.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionApiException(@Nullable String message, @Nullable Throwable cause, StatusCode statusCode, boolean retryable) ApiException(@Nullable String message, @Nullable Throwable cause, StatusCode statusCode, boolean retryable, @Nullable ErrorDetails errorDetails) ApiException(@Nullable Throwable cause, StatusCode statusCode, boolean retryable) ApiException(@Nullable Throwable cause, StatusCode statusCode, boolean retryable, @Nullable ErrorDetails errorDetails) -
Method Summary
Modifier and TypeMethodDescription@Nullable StringReturns the logical grouping to which the "reason" belongs.Returns all standard error messages that server sends.Returns additional structured details about this exception.@Nullable StringReturns the reason of the exception.Returns the status code of the underlying exception.booleanReturns whether the failed request can be retried.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ApiException
-
ApiException
public ApiException(@Nullable String message, @Nullable Throwable cause, StatusCode statusCode, boolean retryable) -
ApiException
public ApiException(@Nullable Throwable cause, StatusCode statusCode, boolean retryable, @Nullable ErrorDetails errorDetails) -
ApiException
public ApiException(@Nullable String message, @Nullable Throwable cause, StatusCode statusCode, boolean retryable, @Nullable ErrorDetails errorDetails)
-
-
Method Details
-
isRetryable
public boolean isRetryable()Returns whether the failed request can be retried. -
getStatusCode
Returns the status code of the underlying exception. -
getReason
Returns the reason of the exception. This is a constant value that identifies the proximate cause of the error. e.g. SERVICE_DISABLED -
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 -
getMetadata
Returns additional structured details about this exception. -
getErrorDetails
Returns all standard error messages that server sends.
-