Package tech.checkhim.models
Class ErrorResponse
java.lang.Object
tech.checkhim.models.ErrorResponse
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCode()Gets the error code from the API.Gets the most appropriate error message to display.getError()Gets the error message from the API.Gets an additional error message if available.voidSets the error code.voidSets the error message.voidsetMessage(String message) Sets an additional error message.toString()
-
Constructor Details
-
ErrorResponse
public ErrorResponse()Default constructor for JSON deserialization.
-
-
Method Details
-
getError
Gets the error message from the API.- Returns:
- The error message
-
setError
Sets the error message.- Parameters:
error- The error message
-
getCode
Gets the error code from the API.- Returns:
- The error code (e.g., "REJECTED_NETWORK")
-
setCode
Sets the error code.- Parameters:
code- The error code
-
getMessage
Gets an additional error message if available.- Returns:
- The additional message
-
setMessage
Sets an additional error message.- Parameters:
message- The additional message
-
getDisplayMessage
Gets the most appropriate error message to display.- Returns:
- The error message, preferring 'error' over 'message'
-
toString
-