-
Notifications
You must be signed in to change notification settings - Fork 180
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
Add onCacheError option #646
Add onCacheError option #646
Conversation
@slukes - I would rather not have another config on this and since it is cache should we just add in EventEmitter3 and emit an error when it goes to a catch? |
Hello @jaredwray I'm not sure how this is going to work! I've created a ticket on our team backlog to dig into this further in the next couple of weeks |
@slukes - what I am saying is that instead of doing an
This would use events to emit an error and by default we would make all methods catch errors and not throw. This gives the resiliency shown in Would that work for you? |
f75d021
to
c0132e7
Compare
@jaredwray thanks to the work of @AdrienDoctolib we now have something that is working how you suggested. Please let us know your feedback. We have tested in our application and all is well 👍 |
@AdrienDoctolib and @slukes looks like we are getting an error on compile time: ![]() |
Sorry about that - fixed! |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #646 +/- ##
===========================================
- Coverage 100.00% 98.96% -1.04%
===========================================
Files 5 5
Lines 365 387 +22
Branches 89 93 +4
===========================================
+ Hits 365 383 +18
- Misses 0 4 +4 ☔ View full report in Codecov by Sentry. |
Please check if the PR fulfills these requirements
Followed the Contributing guidelines.
Tests for the changes have been added (for bug fixes/features) with 100% code coverage.
Docs have been added / updated (for bug fixes / features)
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
This PR addresses:
#643
#588
#51
By re-adding an option that existed in caching.js to 'ignore' cache errors but was removed during the migration to typescript / promises.
This is useful to applications that are using a distant cache store, to enable to application to continue to work, even when the cache backend is down.