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.
Modifier | Constructor and Description |
---|---|
|
LocalizedException(int aStatus,
UserMessage aUserMessage,
Integer anErrorCode)
Constructs a new instance with the provided data.
|
protected |
LocalizedException(int aStatus,
UserMessage aUserMessage,
Integer anErrorCode,
Throwable cause) |
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, Integer anErrorCode)
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.protected LocalizedException(int aStatus, UserMessage aUserMessage, Integer anErrorCode, Throwable cause)
public final Integer getErrorCode()
It may be null
.
public final int getStatus()
public final UserMessage getUserMessage()
It may be null
.