Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to throw error while fetching entries #814

Open
2 of 4 tasks
AdrianDengusiak opened this issue Apr 29, 2024 · 1 comment
Open
2 of 4 tasks

Not possible to throw error while fetching entries #814

AdrianDengusiak opened this issue Apr 29, 2024 · 1 comment

Comments

@AdrianDengusiak
Copy link

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

  • Documentation is unclear
  • Documentation is incorrect
  • Documentation is missing
  • Other
@nlunets
Copy link
Member

nlunets commented Apr 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants