10
Views
3
Comments
Solved
RESTAPI - Catch 400 Bad Request message
Question

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.

mvp_badge
MVP
Rank: #71
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

Rank: #22971

Hi Nordin,

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

Thanks.

mvp_badge
MVP
Rank: #71

You're welcome Rafael!