Class ErrorResponse

java.lang.Object
tech.lastbox.lastshield.security.core.ErrorResponse

public final class ErrorResponse extends Object
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 Details

    • ErrorResponse

      public ErrorResponse(String message, int statusCode)
      Constructs a new ErrorResponse with 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

      public String 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

      public String getTimestamp()
      Gets the timestamp indicating when the error occurred.
      Returns:
      the timestamp of the error occurrence.