Enum Class ClientErrorCodes

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

public enum ClientErrorCodes extends Enum<ClientErrorCodes>
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

    • ENV_RESTRICTED_ASTRA

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

      public static final ClientErrorCodes CONFIG_MISSING
      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 ClientErrorCodes 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.
    • ERROR

      public static final ClientErrorCodes ERROR
      Generic client error with no specific message.
    • HTTP

      public static final ClientErrorCodes HTTP
      Indicates an HTTP error encountered by the client.
    • TIMEOUT

      public static final ClientErrorCodes TIMEOUT
      Indicates a timeout error encountered by the client.
    • INTERRUPTED

      public static final ClientErrorCodes INTERRUPTED
      Indicates an operation was interrupted.
    • RANDOM

      public static final ClientErrorCodes RANDOM
      Placeholder for random client errors.
    • CURSOR

      public static final ClientErrorCodes CURSOR
      Indicates an error related to cursor operations.
    • SERIALIZATION

      public static final ClientErrorCodes SERIALIZATION
      Indicates an error in client-side serialization.
  • Method Details

    • values

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