Mendix has been designed the "Call Rest"-activity to throw an error upon receiving a http-response with statuscode >= 400. So you will have to handle that error like this:
In the true-path, you will have the latetst http-response, hopefully containing a useful message.
If that message is not handing you useful information, try to get their detailed api-definition, try to get into contact with a person handling the api. If that all fails, you can only store the request and response and hope that you can derive their logic someday.
Hi,
yes that does the trick of 'catching' the response error, thank you.
Before accepting this answer, can you elaborate whether I missed something when dealing with the response: I cannot find the response body, which contains the error message by the service. Here is the console log of the HTTP response
you can see there is a JSON body object with a 'message'
however in the debugger I expected the body to be in the content, but it is empty
kind regards
Stefan
Hi,
I just figured out that the 'Consume REST service' action is indeed able to process the response body when status code is 400:
I will hence use the new artifact and call a JSON import mapper for the response body to provide the entity which I can then display as an error.
Thank you very much
Stefan