Hello,

I am consuming a rest api, and in one of the methods, i receive a 400 bad request with a "message" field as the image below.

Is it possible to catch this message field so i can throw it as the exception message instead of 400 bad request?

Thanks.

Solution

Hi Rafael,

Let me provide you with some useful links around handling REST errors.

The blogpost links to an example application in the Forge that demonstrates different options (good and bad practices) around handling REST errors. The third link is a demo lesson around that component.

I'm sure these will be helpful to you.

Regards,

Nordin

Solution

Hi Nordin,

With those links i was able to achieve what i needed.

Thanks.

You're welcome Rafael!