SAP / open-ux-odata

Enable community collaboration to jointly promote and facilitate best in class framework and tooling capabilities when working with OData services.
Apache License 2.0
51 stars 10 forks source link

Not possible to throw error while fetching entries #814

Open AdrianDengusiak opened 4 months ago

AdrianDengusiak commented 4 months ago

Not possible to throw error in getInitialDataSet

I'd like to throw an error when get entity set is called by application. My goal is to simulate error for different scenarios.

Documentation says: The entity interface allow you then to access the standard function (addEntry, fetchEntries, ...) to manipulate the mockdata of the application.

But fetchEntries is not mentioned in any of the API documenatations.

I also can't throw an error in getInitialDataSet.

How can I achievie this for get entity set / get entity? Is there any hook or workaround?

Issue Type

nlunets commented 4 months ago

fetchEntries exist and is not recommended to be overriden for 99% of the scenarios :) But in your case that would be the correct one to throw an error in.

GetInitialDataSet is used to prefill the overall data, so if you break in this one that's just the entire service breaking, which is usually not wanted.

Can you check with an override to fetchEntries and if that's the case i'll adjust the documentation

nlunets commented 1 month ago

@AdrianDengusiak did you check this meanwhile ?