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:
java.io.Serializable
- Direct Known Subclasses:
AbortedException,AlreadyExistsException,CancelledException,DataLossException,DeadlineExceededException,FailedPreconditionException,InternalException,InvalidArgumentException,NotFoundException,OutOfRangeException,PermissionDeniedException,ResourceExhaustedException,UnauthenticatedException,UnavailableException,UnimplementedException,UnknownException,WatchdogTimeoutException
public class ApiException extends java.lang.RuntimeExceptionRepresents an exception thrown during an RPC call.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ApiException(java.lang.String message, java.lang.Throwable cause, StatusCode statusCode, boolean retryable)ApiException(java.lang.Throwable cause, StatusCode statusCode, boolean retryable)ApiException(java.lang.Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDomain()Returns the logical grouping to which the "reason" belongs.ErrorDetailsgetErrorDetails()Returns all standard error messages that server sends.java.util.Map<java.lang.String,java.lang.String>getMetadata()Returns additional structured details about this exception.java.lang.StringgetReason()Returns the reason of the exception.StatusCodegetStatusCode()Returns the status code of the underlying exception.booleanisRetryable()Returns whether the failed request can be retried.
-
-
-
Constructor Detail
-
ApiException
public ApiException(java.lang.Throwable cause, StatusCode statusCode, boolean retryable)
-
ApiException
public ApiException(java.lang.String message, java.lang.Throwable cause, StatusCode statusCode, boolean retryable)
-
ApiException
public ApiException(java.lang.Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails)
-
-
Method Detail
-
isRetryable
public boolean isRetryable()
Returns whether the failed request can be retried.
-
getStatusCode
public StatusCode getStatusCode()
Returns the status code of the underlying exception.
-
getReason
public java.lang.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
-
getDomain
public java.lang.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
-
getMetadata
public java.util.Map<java.lang.String,java.lang.String> getMetadata()
Returns additional structured details about this exception.
-
getErrorDetails
public ErrorDetails getErrorDetails()
Returns all standard error messages that server sends.
-
-