Class 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

public class ApiException extends RuntimeException
Represents an exception thrown during an RPC call.
See Also:
  • Constructor Details

  • Method Details

    • 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 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 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 Map<String,String> getMetadata()
      Returns additional structured details about this exception.
    • getErrorDetails

      public ErrorDetails getErrorDetails()
      Returns all standard error messages that server sends.