Enum Class ErrorKind

java.lang.Object
java.lang.Enum<ErrorKind>
com.surrealdb.ErrorKind
All Implemented Interfaces:
Serializable, Comparable<ErrorKind>, Constable

public enum ErrorKind extends Enum<ErrorKind>
Machine-readable error kind, aligned with the SurrealDB Rust SDK's ErrorDetails enum.

Returned by ServerException.getKindEnum(). Use this for type-safe matching instead of ServerException.getKind() when the kind is known. For unknown (future) kinds, UNKNOWN is used and the raw string is available via ServerException.getKind().

  • Enum Constant Details

    • VALIDATION

      public static final ErrorKind VALIDATION
    • CONFIGURATION

      public static final ErrorKind CONFIGURATION
    • THROWN

      public static final ErrorKind THROWN
    • QUERY

      public static final ErrorKind QUERY
    • SERIALIZATION

      public static final ErrorKind SERIALIZATION
    • NOT_ALLOWED

      public static final ErrorKind NOT_ALLOWED
    • NOT_FOUND

      public static final ErrorKind NOT_FOUND
    • ALREADY_EXISTS

      public static final ErrorKind ALREADY_EXISTS
    • CONNECTION

      public static final ErrorKind CONNECTION
    • INTERNAL

      public static final ErrorKind INTERNAL
    • UNKNOWN

      public static final ErrorKind UNKNOWN
      Unknown kind from a newer server; raw string is in ServerException.getKind().
  • Method Details

    • values

      public static ErrorKind[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ErrorKind valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • fromString

      public static ErrorKind fromString(String kind)
      Resolves a kind string from the wire to an enum constant. Unknown strings return UNKNOWN.
      Parameters:
      kind - the kind string (e.g. from the server)
      Returns:
      the matching enum constant, or UNKNOWN
    • getRaw

      public String getRaw()
      Returns the wire string for this kind, or null for UNKNOWN.