cancel
Showing results for 
Search instead for 
Did you mean: 

OData v4 ListBinding create(obj).created() doesn't continue on an error

dvvelzen
Participant
0 Kudos
243

Hi,

I'm trying to implement a controller OData v4 create on a ListBinding as described on the documentation page. Essentials > Data Binding > Models > OData V4 Model > Creating an Entitiy

https://sapui5.hana.ondemand.com/#/topic/c9723f8265f644af91c0ed941e114d46

dvvelzen_0-1719049515688.png

When the backend returns an error (in our case because we have a unique constraint on one of the fields, but it can just be mimic-ed by having CAP send a reject('some reason) in the onHandler) the error shows in the developer console logging. However the execution stops on the "created()" Promise. It doesn't go into the .then() or .catch().

I found similar older issues on the links below. 

https://community.sap.com/t5/technology-q-a/odata-v4-context-created-how-to-catch-an-error/qaq-p/119...

https://github.com/SAP/openui5/issues/3760

Any ideas?

 

View Entire Topic
Noel_Hendrikx
Active Contributor
0 Kudos

Hi,

In your error handler you are expecting a property called canceled (isn't that with double l?). Please check if that property exist, otherwise you have a js error in an error handler and nothing will happen.

Kind regards,

Noël

dvvelzen
Participant
0 Kudos
Hi Noël, Thanks for the reply, but this is just a screenshot from the UI5 documentation page. I just log any error (without a check), but it isn't going into either the .then() or .catch() alltogether. Kind regards, Dennis