Class ErrorResponse

java.lang.Object
tech.checkhim.models.ErrorResponse

public class ErrorResponse extends Object
Represents an error response from the CheckHim API. This class is used internally to parse error responses and convert them to appropriate exception types.
  • Constructor Details

    • ErrorResponse

      public ErrorResponse()
      Default constructor for JSON deserialization.
  • Method Details

    • getError

      public String getError()
      Gets the error message from the API.
      Returns:
      The error message
    • setError

      public void setError(String error)
      Sets the error message.
      Parameters:
      error - The error message
    • getCode

      public String getCode()
      Gets the error code from the API.
      Returns:
      The error code (e.g., "REJECTED_NETWORK")
    • setCode

      public void setCode(String code)
      Sets the error code.
      Parameters:
      code - The error code
    • getMessage

      public String getMessage()
      Gets an additional error message if available.
      Returns:
      The additional message
    • setMessage

      public void setMessage(String message)
      Sets an additional error message.
      Parameters:
      message - The additional message
    • getDisplayMessage

      public String getDisplayMessage()
      Gets the most appropriate error message to display.
      Returns:
      The error message, preferring 'error' over 'message'
    • toString

      public String toString()
      Overrides:
      toString in class Object