Cloud Jasmin DevelopmentConcepts
DevelopmentConcepts
Concepts
Back | List of Articles

Error messages

Last changed in 26/08/2022

If executing a Web API request generates an error, the response will include a status code that indicates the error condition.

However, this code may not always be enough to determine the condition that caused the error. In these cases, the response body will include additional information.

Examples

If, for example, executing the endpoint to create an entity generates an error due to there already being an entity with the same key, the response obtained will have status code 400 and the validation message will be returned in the body of the message.

{
    "message": "This record already exists in the data repository of the Payment Term entity.",
    "%ERRORCODE%": "DataExceptionErrorCode.EntityAlreadyExists"
}

If you try to delete a record that does not exist, the status code will be 404 and you will see the following message:

{
    "message": "The 'Payment Term' was not found."
}

%ERRORCODE%

Please note that the response from the first example includes an attribute with the name %ERRORCODE%. This attribute is returned in the result whenever the same status code can be returned for different errors and the application processing the response can handle these cases in some different way.

Bookmark or share this article
Esta página foi útil?
Obrigado pelo seu voto.

login para deixar a sua opinião.

Obrigado pelo seu feedback. Iremos analisá-lo para continuarmos a melhorar!
Artigos Relacionados
Quais são os endpoints da Web API? Características da Web API Primavera Formato dos pedidos e respostas Mensagens de erro Entidades base e extensões