Class ErrorResponse
java.lang.Object
tech.lastbox.lastshield.security.core.ErrorResponse
Represents a standardized error response format for API error messages.
This class contains three key properties: a message describing the error, the HTTP status code associated with the error, and a timestamp indicating when the error occurred.
-
Constructor Summary
ConstructorsConstructorDescriptionErrorResponse(String message, int statusCode) Constructs a newErrorResponsewith the specified error message and status code. -
Method Summary
Modifier and TypeMethodDescriptionGets the error message.intGets the HTTP status code associated with the error.Gets the timestamp indicating when the error occurred.
-
Constructor Details
-
ErrorResponse
Constructs a newErrorResponsewith the specified error message and status code. The timestamp is automatically set to the current date and time.- Parameters:
message- the error message to be included in the response.statusCode- the HTTP status code representing the error.
-
-
Method Details
-
getMessage
Gets the error message.- Returns:
- the error message.
-
getStatusCode
public int getStatusCode()Gets the HTTP status code associated with the error.- Returns:
- the HTTP status code.
-
getTimestamp
Gets the timestamp indicating when the error occurred.- Returns:
- the timestamp of the error occurrence.
-