485
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.

2021-08-12 11-00-27
Nordin Ahdi
 
MVP
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

UserImage.jpg
Rafael Battistelo

Hi Nordin,

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

Thanks.

2021-08-12 11-00-27
Nordin Ahdi
 
MVP

You're welcome Rafael!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.