Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

The form of the responses in case of an error, differs dependent of the thrown error.

HTTP 422 Unprocessable Entity / HTTP 409 Conflict

According to the definition of HTTP response codes, the request delivers data which can not be processed or are invalid for the requested entity, or the creation / update of such an entity would lead to an conflict in the application. In both cases the result will look like the following example:

{
	"errorCode": "E1094",
	"httpStatus": 422,
	"errorMessage": "User can not be saved: the chosen login does already exist.",
	"message": "Unprocessable Entity",
	"success": false,
	"errors": {
		"login": ["duplicateLogin"]
	},
	"errorsTranslated": {
		"login": ["Dieser Anmeldename wird bereits verwendet."]
	}
}

Explanation of the single fields

FieldExample Value / TypeDescription
errorCodeE1094This is the error code linking to a brief description / explanation of the problem in the translate5 event code list.
httpStatus422 or 409The HTTP status of the answer, as returned also in the request headers. In the explained case 422 or 409.
errorMessagesee aboveA short explanation of the error in english.
messageUnprocessable EntityThe textual representation of the HTTP status code, here "Unprocessable Entity" or "Conflict"
successtrue or falsesimple flag representing the success state of the response, here of course false.
errorshashmapA hashmap containing the input field containing the value which produces the problem, and an array of string identifier of the problem in english.
errorsTranslatedhashmapThe same structure as the above errors field, with the difference that the error texts are translated in the language of the currently authenticated user.



  • No labels