Class DataAPIErrorDescriptor

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.datastax.astra.client.exceptions.DataAPIErrorDescriptor
All Implemented Interfaces:
Serializable

public class DataAPIErrorDescriptor extends RuntimeException
Encapsulates error details from a JSON API response. This class is used to represent error information such as messages, codes, and exception classes associated with an API request failure. It allows for a structured way to convey error details from the server to the client.
See Also:
  • Constructor Details

    • DataAPIErrorDescriptor

      public DataAPIErrorDescriptor()
      Default constructor for DataAPIErrorDescriptor. Initializes a new instance of the class without setting any properties. Properties should be set via their setters or directly, depending on the usage context and the framework's conventions.
  • Method Details

    • getErrorMessage

      public String getErrorMessage()
      Constructs a comprehensive error message by combining the exception class name, error code, and the detailed message. This method is useful for logging or displaying a complete error message to the end-user or developer.
      Returns:
      A concatenated string representing the full error message, which may include the exception class name, the error code in parentheses, and the detailed error message. Each element is included only if it is not null.
    • getLocalizedMessage

      public String getLocalizedMessage()
      Overrides:
      getLocalizedMessage in class Throwable