Hi All,
We are building an interactive grid APEX page on a rest data source. The rest data source is created over rest apis developed in ORDS and supports various HTTP methods, such as GET, POST, DELETE etc. which are mapped to various IG functions as Query, Update, Insert, Delete etc.
We could get the interactive grid work for most of our transactions without any issues. However, if an error is returned from the POST API on update of a row in the IG, we are unable to trap the error and show the error message returned by the API. As an example, if everything goes well, API Response is as below.
HTTP Status Code:200
HTTP Response body: {"message":"records updated successfully, number of records=181"}
This reflects in the APEX page as "Changes Saved"
If the business validations fail at the API backend, the API response is as below
HTTP Status Code:400
HTTP Response body: {"message":"Invalid update, employee is not eligible for this leave type"}
This shows as below error message in the UI
"ORA-20999: REST Data Source returned an HTTP error: HTTP 400: Bad request"
Is there anyway we could capture the message from the response body and show it in the screen?