loopback-datasource-juggler
loopback-datasource-juggler copied to clipboard
fix: add error handling in case of unvailable cache server
In case of an unavailable datasource server (like the Redis server), the app crashes.
With this PR, the users can add an option in the datasource config named catchFailure
and set its value to true. This would prevent the app from crashing and show the connection failure error in the console.
Checklist
- [x] Sign off your commits with DCO (Developer Certificate of Origin)
- [x]
npm test
passes on your machine - [ ] New tests added or existing tests modified to cover all changes
- [x] Code conforms with the style guide
- [x] Commit messages are following our guidelines
Pull Request Test Coverage Report for Build 8128945264
Details
- 0 of 5 (0.0%) changed or added relevant lines in 1 file are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage decreased (-0.04%) to 84.762%
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
---|---|---|---|
lib/datasource.js | 0 | 5 | 0.0% |
<!-- | Total: | 0 | 5 |
Totals | |
---|---|
Change from base Build 8084044252: | -0.04% |
Covered Lines: | 7267 |
Relevant Lines: | 8268 |
💛 - Coveralls
Hi, @samarpanB. I've made the changes to be optional as you suggested. Can you please confirm if we can move forward with the PR?
LGTM, but I would like to get one more approval on this before merging.
Hi, @dhmlau. Can you have a look at this PR please?
Any ideas when this will get merged in?