Package com.google.cloud.spanner
Class SpannerException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.google.cloud.BaseServiceException
-
- com.google.cloud.grpc.BaseGrpcServiceException
-
- com.google.cloud.spanner.SpannerException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AbortedException
,AdminRequestsPerMinuteExceededException
,SpannerBatchUpdateException
,SpannerException.ResourceNotFoundException
public class SpannerException extends com.google.cloud.grpc.BaseGrpcServiceException
Base exception type for all exceptions produced by the Cloud Spanner service.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SpannerException.ResourceNotFoundException
Base exception type for NOT_FOUND exceptions for known resource types.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDomain()
Checks the underlying reason of the exception and if it'sApiException
then return the specific domain otherwise null.ErrorCode
getErrorCode()
Returns the error code associated with this exception.com.google.api.gax.rpc.ErrorDetails
getErrorDetails()
Checks the underlying reason of the exception and if it'sApiException
then return the ErrorDetails otherwise null.Map<String,String>
getMetadata()
Checks the underlying reason of the exception and if it'sApiException
then return a map of key-value pairs otherwise null.String
getReason()
Checks the underlying reason of the exception and if it'sApiException
then return the reason otherwise null.long
getRetryDelayInMillis()
Return the retry delay for operation in milliseconds.-
Methods inherited from class com.google.cloud.BaseServiceException
equals, getCode, getDebugInfo, getLocation, hashCode, isRetryable, isRetryable, isRetryable, translate, translate
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Method Detail
-
getErrorCode
public ErrorCode getErrorCode()
Returns the error code associated with this exception.
-
getRetryDelayInMillis
public long getRetryDelayInMillis()
Return the retry delay for operation in milliseconds. Return -1 if this does not specify any retry delay.
-
getReason
public String getReason()
Checks the underlying reason of the exception and if it'sApiException
then return the reason otherwise null.- Overrides:
getReason
in classcom.google.cloud.BaseServiceException
- Returns:
- the reason of an error.
- See Also:
- Reason
-
getDomain
public String getDomain()
Checks the underlying reason of the exception and if it'sApiException
then return the specific domain otherwise null.- Returns:
- the logical grouping to which the "reason" belongs.
- See Also:
- Domain
-
getMetadata
public Map<String,String> getMetadata()
Checks the underlying reason of the exception and if it'sApiException
then return a map of key-value pairs otherwise null.- Returns:
- the map of additional structured details about an error.
- See Also:
- Metadata
-
getErrorDetails
public com.google.api.gax.rpc.ErrorDetails getErrorDetails()
Checks the underlying reason of the exception and if it'sApiException
then return the ErrorDetails otherwise null.- Returns:
- An object containing getters for structured objects from error_details.proto.
- See Also:
- Status, Error Details
-
-