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 via SpannerException.getErrorCode().
  • Enum Constant Details

    • 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 Details

    • values

      public static ErrorCode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      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 name
      NullPointerException - 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, or UNKNOWN if not recognized.