public class LocalizedException extends WebApplicationException
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.
Constructor and Description |
---|
LocalizedException(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.
|
Modifier and Type | Method and Description |
---|---|
Integer |
getErrorCode()
Returns the functional error code provided by the REST service.
|
int |
getStatus()
Returns the HTTP status code associated with the response.
|
UserMessage |
getUserMessage()
Returns the user message that may be displayed to the
end user as an error message.
|
getResponse
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public LocalizedException(int aStatus, UserMessage aUserMessage)
public LocalizedException(int aStatus, UserMessage aUserMessage, Throwable aCause)
LocalizedException(int, UserMessage, Integer, Throwable)
public LocalizedException(int aStatus, UserMessage aUserMessage, Integer anErrorCode)
public LocalizedException(int aStatus, UserMessage aUserMessage, Integer anErrorCode, Throwable aCause)
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 exceptionpublic final Integer getErrorCode()
It may be null
.
public final int getStatus()
public final UserMessage getUserMessage()
It may be null
.