Package com.orchestranetworks.rest
Class LocalizedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
jakarta.ws.rs.WebApplicationException
com.orchestranetworks.rest.LocalizedException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AuthenticationException
,UnprocessableEntityException
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 Summary
ConstructorDescriptionLocalizedException
(int aStatus, UserMessage aUserMessage) LocalizedException
(int aStatus, UserMessage aUserMessage, Integer anErrorCode) LocalizedException
(int aStatus, UserMessage aUserMessage, Integer anErrorCode, Throwable aCause) Constructs a new instance with the provided data.LocalizedException
(int aStatus, UserMessage aUserMessage, Throwable aCause) Constructs a new instance with the provided data, without functional error code. -
Method Summary
Modifier and TypeMethodDescriptionfinal Integer
Returns the functional error code provided by the REST service.final int
Returns the HTTP status code associated with the response.final UserMessage
Returns the user message that may be displayed to the end user as an error message.Methods inherited from class jakarta.ws.rs.WebApplicationException
getResponse
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
LocalizedException
-
LocalizedException
Constructs a new instance with the provided data, without functional error code.- Since:
- 6.0.0
- See Also:
-
LocalizedException
-
LocalizedException
public LocalizedException(int aStatus, UserMessage aUserMessage, Integer anErrorCode, Throwable aCause) 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.aCause
- The underlying cause of this thrown exception
-
-
Method Details
-
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
Returns the user message that may be displayed to the end user as an error message.It may be
null
.
-