cancel
Showing results for 
Search instead for 
Did you mean: 

Catching connection error with SAPUI5 OData Model V4

Hello colleagues,

I would like to ask how can I catch errors using SAPUI5 OData Model V4, if the connection to the backend application has failed and the following errors are triggered:

  • Could not load metadata: 500 Server Internal Error;
  • Communication Error: 500 Server Server Error.

I looked in the OData Model V4 documentation and none of the events (parseError, requestFailed, etc.) available for OData Model V2 are supported for OData Model V4. ( https://sapui5.hana.ondemand.com/#/api/sap.ui.model.odata.v4.ODataModel%23events/Summary)From what I noticed for OData Model V4 only the sessionTimeout event is available.Having no event I do not know where would be the right place to implement callback function to be called in case the connection with the backend application failed.Appreciate any information and advice!
Thanks.
View Entire Topic
xstava
Explorer
0 Kudos
model.getMetaModel().requestObject("/").then(
                    function (data) {
                        //Success
                    }.bind(this),
                    function (data) {
                       //Error
                    }.bind(this));