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,MissingDefaultSequenceKindException,SpannerBatchUpdateException,SpannerException.ResourceNotFoundException,TransactionMutationLimitExceededException
public class SpannerException
extends com.google.cloud.grpc.BaseGrpcServiceException
Base exception type for all exceptions produced by the Cloud Spanner service.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBase exception type for NOT_FOUND exceptions for known resource types.Nested classes/interfaces inherited from class com.google.cloud.BaseServiceException
com.google.cloud.BaseServiceException.Error, com.google.cloud.BaseServiceException.ExceptionData -
Field Summary
Fields inherited from class com.google.cloud.BaseServiceException
UNKNOWN_CODE -
Method Summary
Modifier and TypeMethodDescriptionChecks the underlying reason of the exception and if it'sApiExceptionthen return the specific domain otherwise null.Returns the error code associated with this exception.com.google.api.gax.rpc.ErrorDetailsChecks the underlying reason of the exception and if it'sApiExceptionthen return the ErrorDetails otherwise null.Checks the underlying reason of the exception and if it'sApiExceptionthen return a map of key-value pairs otherwise null.Returns the PostgreSQL SQLState error code that is encoded in this exception, or null if thisSpannerExceptiondoes not include a PostgreSQL error code.Checks the underlying reason of the exception and if it'sApiExceptionthen return the reason otherwise null.longReturn the retry delay for operation in milliseconds.toString()Methods inherited from class com.google.cloud.BaseServiceException
equals, getCode, getDebugInfo, getLocation, hashCode, isRetryable, isRetryable, isRetryable, translate, translateMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Method Details
-
getMessage
- Overrides:
getMessagein classThrowable
-
toString
-
getErrorCode
Returns the error code associated with this exception. -
getPostgreSQLErrorCode
Returns the PostgreSQL SQLState error code that is encoded in this exception, or null if thisSpannerExceptiondoes not include a PostgreSQL error code. -
getRequestId
-
getRetryDelayInMillis
public long getRetryDelayInMillis()Return the retry delay for operation in milliseconds. Return -1 if this does not specify any retry delay. -
getReason
Checks the underlying reason of the exception and if it'sApiExceptionthen return the reason otherwise null.- Overrides:
getReasonin classcom.google.cloud.BaseServiceException- Returns:
- the reason of an error.
- See Also:
-
getDomain
Checks the underlying reason of the exception and if it'sApiExceptionthen return the specific domain otherwise null.- Returns:
- the logical grouping to which the "reason" belongs.
- See Also:
-
getMetadata
Checks the underlying reason of the exception and if it'sApiExceptionthen return a map of key-value pairs otherwise null.- Returns:
- the map of additional structured details about an error.
- See Also:
-
getErrorDetails
public com.google.api.gax.rpc.ErrorDetails getErrorDetails()Checks the underlying reason of the exception and if it'sApiExceptionthen return the ErrorDetails otherwise null.- Returns:
- An object containing getters for structured objects from error_details.proto.
- See Also:
-