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
public class BaseServiceException extends RuntimeException
Base class for all service exceptions.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBaseServiceException.Errorstatic classBaseServiceException.ExceptionData
-
Field Summary
Fields Modifier and Type Field Description static intUNKNOWN_CODE
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseServiceException(BaseServiceException.ExceptionData exceptionData)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)intgetCode()Returns the code associated with this exception.StringgetDebugInfo()StringgetLocation()Returns the service location where the error causing the exception occurred.StringgetReason()Returns the reason that caused the exception.inthashCode()booleanisRetryable()Returnstruewhen 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 voidtranslate(RetryHelper.RetryHelperException ex)static voidtranslate(ExecutionException ex)-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
UNKNOWN_CODE
public static final int UNKNOWN_CODE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BaseServiceException
@InternalApi("This class should only be extended within google-cloud-java") protected BaseServiceException(BaseServiceException.ExceptionData exceptionData)
-
-
Method Detail
-
isRetryable
@InternalApi public static boolean isRetryable(Integer code, String reason, boolean idempotent, Set<BaseServiceException.Error> retryableErrors)
-
isRetryable
@InternalApi public static boolean isRetryable(boolean idempotent, IOException exception)
-
translate
@InternalApi public static void translate(RetryHelper.RetryHelperException ex)
-
translate
@InternalApi public static void translate(ExecutionException ex)
-
getCode
public int getCode()
Returns the code associated with this exception.
-
getReason
public String 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
public String getLocation()
Returns the service location where the error causing the exception occurred. Returnsnullif not available.
-
getDebugInfo
@InternalApi public String getDebugInfo()
-
-