When retrieving data from a REST API, if the service returns an HTTP error status code (400 and above), OutSystems throws an exception. This allows you to easily handle the REST API error by implementing your own logic.
To handle a REST API error, do the following:
- Add an Exception Handler in the logic that uses the REST API, and set the Exception Handler to catch
- Implement the logic to handle the error, like displaying a message to the end-user.