Enum Class ErrorCodesClient

java.lang.Object
java.lang.Enum<ErrorCodesClient>
com.datastax.astra.client.exceptions.ErrorCodesClient
All Implemented Interfaces:
Serializable, Comparable<ErrorCodesClient>, Constable

public enum ErrorCodesClient extends Enum<ErrorCodesClient>
Represents client error codes used to standardize error reporting in the application. Each error code is associated with a unique identifier (`code`) and a descriptive message (`message`).

This enum is designed to facilitate consistent error handling and logging across various components. Some codes are pre-configured with detailed messages that accept placeholders for dynamic values, while others are placeholders for future implementation.

Example usage:

 
 String errorCode = ClientErrorCodes.CONFIG_MISSING.getCode();
 String errorMessage = String.format(ClientErrorCodes.CONFIG_MISSING.getMessage(), "paramName", "operationName");
 
 
  • Enum Constant Details

    • ASTRA_RESTRICTED_OPERATION

      public static final ErrorCodesClient ASTRA_RESTRICTED_OPERATION
      Indicates that the operation is restricted to Astra environments. Dynamic placeholders:
      • '%s': The operation name.
      • '%s': The current environment.
    • MISSING_CONFIGURATION

      public static final ErrorCodesClient MISSING_CONFIGURATION
      Indicates that a required configuration parameter is missing. Dynamic placeholders:
      • '%s': The name of the missing configuration parameter.
      • '%s': The operation requiring the parameter.
    • MISSING_ANNOTATION

      public static final ErrorCodesClient MISSING_ANNOTATION
      Indicates that a required annotation is missing from a bean. Dynamic placeholders:
      • '%s': The name of the missing annotation.
      • '%s': The name of the bean.
      • '%s': The operation requiring the annotation.
    • INVALID_ANNOTATION

      public static final ErrorCodesClient INVALID_ANNOTATION
      Indicates that an annotation on a bean is invalid. Dynamic placeholders:
      • '%s': The name of the invalid annotation.
      • '%s': The name of the bean.
      • '%s': The cause of the invalid annotation.
    • INVALID_VALUE

      public static final ErrorCodesClient INVALID_VALUE
      Indicates that a field value is invalid. Dynamic placeholders:
      • '%s': The invalid value.
      • '%s': The name of the field.
    • INVALID_EXPRESSION

      public static final ErrorCodesClient INVALID_EXPRESSION
      Indicates a field name was invalid and cannot be escaped Dynamic placeholders:
      • '%s': The value for the field to escape
    • SERIALIZATION_ERROR

      public static final ErrorCodesClient SERIALIZATION_ERROR
      Indicates an error in client-side serialization.
    • DESERIALIZATION_ERROR

      public static final ErrorCodesClient DESERIALIZATION_ERROR
      Indicates an error in client-side serialization.
  • Method Details

    • values

      public static ErrorCodesClient[] 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 ErrorCodesClient 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