I am getting error after REST API response timeout innerHTML undefined i have to overwrite this message into meaningful message.
Hi Apoorv,
The documentation that César Shared, explains how to Customize the response of an API that you are exposing.
In case you are consuming an external API and this API is returning an error that you want to handle, you can check this documentation.
Basically you can do it in 2 ways.
The first one, is wrapping your REST Call in an action, and in this action you can create an error handler flow:
This way you can have a specific message if the default error message or the error code is the one you want to handle. Doing it this way will also ensure this exception will be handled only for this call using this action.
________If you want a broader solution that will be used by all methods in an API endpoint, or even if you want to get and parse your response even before OutSystems throw an exception, you can go with the second way, which is creating a OnAfterResponse action event to your REST endpoint where you can change the response content and even the response code:
To do that, select your Main Rest API node on the Service Studio, and on its properties you will see an OnAfterResponse event that you can create:
Hope it helps,
Cheers and Regards,RR :)
Hi Raphael Ranieri Thankyou For Your Solution It Works for Response API Status I Can Overwrite My Message Into Meaningful After Exception Handling.
Here some articles maybe can help you out.
https://www.outsystems.com/blog/posts/implementing-http-status-code-exposing-rest/
https://success.outsystems.com/Documentation/11_x_platform/Extensibility_and_Integration/REST/Expose_REST_APIs
https://success.outsystems.com/Documentation/11_x_platform/Extensibility_and_Integration/REST/Expose_REST_APIs/Customize_REST_API_Responses
Regards
Here is the useful link where you will find solution easily please take reference and resolve your issue.
https://www.outsystems.com/forums/discussion/56296/rest-api-timeout-issue/
Make a nice day!!
Kind Regards,
Ajit Kurane.