Package com.google.cloud.spanner
Enum ErrorCode
- java.lang.Object
-
- java.lang.Enum<ErrorCode>
-
- com.google.cloud.spanner.ErrorCode
-
- All Implemented Interfaces:
Serializable
,Comparable<ErrorCode>
public enum ErrorCode extends Enum<ErrorCode>
Enumerates the major types of error that the Cloud Spanner service can produce. These codes are accessible viaSpannerException.getErrorCode()
.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ABORTED
ALREADY_EXISTS
CANCELLED
DATA_LOSS
DEADLINE_EXCEEDED
FAILED_PRECONDITION
INTERNAL
INVALID_ARGUMENT
NOT_FOUND
OUT_OF_RANGE
PERMISSION_DENIED
RESOURCE_EXHAUSTED
UNAUTHENTICATED
UNAVAILABLE
UNIMPLEMENTED
UNKNOWN
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ErrorCode
fromGrpcStatus(io.grpc.Status status)
Returns the error code corresponding to a gRPC status, orUNKNOWN
if not recognized.io.grpc.Status.Code
getGrpcStatusCode()
static ErrorCode
valueOf(String name)
Returns the enum constant of this type with the specified name.static ErrorCode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CANCELLED
public static final ErrorCode CANCELLED
-
UNKNOWN
public static final ErrorCode UNKNOWN
-
INVALID_ARGUMENT
public static final ErrorCode INVALID_ARGUMENT
-
DEADLINE_EXCEEDED
public static final ErrorCode DEADLINE_EXCEEDED
-
NOT_FOUND
public static final ErrorCode NOT_FOUND
-
ALREADY_EXISTS
public static final ErrorCode ALREADY_EXISTS
-
PERMISSION_DENIED
public static final ErrorCode PERMISSION_DENIED
-
UNAUTHENTICATED
public static final ErrorCode UNAUTHENTICATED
-
RESOURCE_EXHAUSTED
public static final ErrorCode RESOURCE_EXHAUSTED
-
FAILED_PRECONDITION
public static final ErrorCode FAILED_PRECONDITION
-
ABORTED
public static final ErrorCode ABORTED
-
OUT_OF_RANGE
public static final ErrorCode OUT_OF_RANGE
-
UNIMPLEMENTED
public static final ErrorCode UNIMPLEMENTED
-
INTERNAL
public static final ErrorCode INTERNAL
-
UNAVAILABLE
public static final ErrorCode UNAVAILABLE
-
DATA_LOSS
public static final ErrorCode DATA_LOSS
-
-
Method Detail
-
values
public static ErrorCode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ErrorCode c : ErrorCode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ErrorCode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getGrpcStatusCode
public io.grpc.Status.Code getGrpcStatusCode()
- Returns:
- the corresponding gRPC status code of this
ErrorCode
.
-
fromGrpcStatus
public static ErrorCode fromGrpcStatus(io.grpc.Status status)
Returns the error code corresponding to a gRPC status, orUNKNOWN
if not recognized.
-
-