Package com.google.cloud
Class BaseServiceException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.google.cloud.BaseServiceException
- All Implemented Interfaces:
Serializable
Base class for all service exceptions.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseServiceException(BaseServiceException.ExceptionData exceptionData) -
Method Summary
Modifier and TypeMethodDescriptionbooleanintgetCode()Returns the code associated with this exception.Returns the service location where the error causing the exception occurred.Returns the reason that caused the exception.inthashCode()booleanReturnstruewhen it is safe to retry the operation that caused this exception.static booleanisRetryable(boolean idempotent, IOException exception) static booleanisRetryable(Integer code, String reason, boolean idempotent, Set<BaseServiceException.Error> retryableErrors) static voidstatic voidMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
UNKNOWN_CODE
public static final int UNKNOWN_CODE- See Also:
-
-
Constructor Details
-
BaseServiceException
@InternalApi("This class should only be extended within google-cloud-java") protected BaseServiceException(BaseServiceException.ExceptionData exceptionData)
-
-
Method Details
-
isRetryable
@InternalApi public static boolean isRetryable(Integer code, String reason, boolean idempotent, Set<BaseServiceException.Error> retryableErrors) -
isRetryable
-
translate
-
translate
-
getCode
public int getCode()Returns the code associated with this exception. -
getReason
Returns the reason that caused the exception. -
isRetryable
public boolean isRetryable()Returnstruewhen it is safe to retry the operation that caused this exception. -
getLocation
Returns the service location where the error causing the exception occurred. Returnsnullif not available. -
getDebugInfo
-
equals
-
hashCode
public int hashCode()
-