Package com.orchestranetworks.rest
Class UnprocessableEntityException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
jakarta.ws.rs.WebApplicationException
com.orchestranetworks.rest.LocalizedException
com.orchestranetworks.rest.UnprocessableEntityException
- All Implemented Interfaces:
Serializable
A runtime exception indicating that the request was understood and
the syntax was correct but that the server was unable to process
the contained instructions. For example, this may occur if
data validation failed.
This exception will always report an HTTP error status 422.
If the response uses JSON format, content will have the following form:
{ "code": 999, // JSON Number, HTTP error code or EBX® error code // in case of HTTP error 422 (optional) "errors": [ // Additional messages to give details (optional). { "message": "Message 1" // JSON String }, { "message": "Message 2" } ] }
- Since:
- 5.9.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
HTTP status code for Unprocessable Entity Error. -
Constructor Summary
ConstructorDescriptionCreates an unprocessable entity exception without message.UnprocessableEntityException
(UserMessage aUserMessage) Creates an unprocessable entity exception.UnprocessableEntityException
(UserMessage aUserMessage, Integer anErrorCode) Creates an unprocessable entity exception.UnprocessableEntityException
(String aUserMessage) Creates an unprocessable entity exception.UnprocessableEntityException
(String aUserMessage, Integer anErrorCode) Creates an unprocessable entity exception. -
Method Summary
Methods inherited from class com.orchestranetworks.rest.LocalizedException
getErrorCode, getStatus, getUserMessage
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
-
Field Details
-
HTTP_SC_UNPROCESSABLE_ENTITY
public static final int HTTP_SC_UNPROCESSABLE_ENTITYHTTP status code for Unprocessable Entity Error.This status code is mainly used to report functional errors.
- See Also:
-
-
Constructor Details
-
UnprocessableEntityException
public UnprocessableEntityException()Creates an unprocessable entity exception without message. -
UnprocessableEntityException
Creates an unprocessable entity exception. -
UnprocessableEntityException
Creates an unprocessable entity exception. -
UnprocessableEntityException
Creates an unprocessable entity exception.The provided user message, seen as String, will be transformed into a
UserMessage
object. -
UnprocessableEntityException
Creates an unprocessable entity exception.- Parameters:
aUserMessage
- the localized message that may be displayed to the end user.anErrorCode
- the functional error code. This code is defined by the REST service and may benull
.
-