Class LocalizedException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AuthenticationException, UnprocessableEntityException

public class LocalizedException extends WebApplicationException
Class that can be extended by exceptions that return a localized error message.

If thrown by REST services and not caught, they will be automatically transformed into an appropriate JAX-RS HTTP response and may be displayed to the end user.

Since:
5.9.0
See Also:
  • Constructor Details

    • LocalizedException

      public LocalizedException(int aStatus, UserMessage aUserMessage, Integer anErrorCode)
      Constructs a new instance with the provided data.
      Parameters:
      aStatus - the HTTP status code that will be returned to the client.
      aUserMessage - the localized message that may be displayed to the end user.
      anErrorCode - the functional error code.
    • LocalizedException

      protected LocalizedException(int aStatus, UserMessage aUserMessage, Integer anErrorCode, Throwable cause)
  • Method Details

    • getErrorCode

      public final Integer getErrorCode()
      Returns the functional error code provided by the REST service.

      It may be null.

    • getStatus

      public final int getStatus()
      Returns the HTTP status code associated with the response.
    • getUserMessage

      public final UserMessage getUserMessage()
      Returns the user message that may be displayed to the end user as an error message.

      It may be null.