-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
When database is not available, fatal error should not propagate. #29
Comments
This is likely do to an unhandled This module should of course handle those The easy fix would be to just add an empty You can do this yourself right now if you provide your own |
I would not go to PR, there is really too many things I'd like to understand first :) My first ever app with express, baby steps. What I have tried and found sufficient was this (repeating what I seen in your other function):
But I got no idea why it's helping :) |
That shouldn't really change anything apart from the fact that It shouldn't make a difference in whether an exception is thrown or not so the application should still crash as much or as little anyway (unless you have set up some Express error handling that throws those errors as exceptions rather than return |
Ack. Thanks for detailed info. |
I'm new to node and may not have good way of describing this issue, bear with me please.
When get() called and database is suddenly unavailable it's probably not a best behavior to propagate error all the way and crush application.
I wondered if modifying get() behavior when query returns error is a good thing or no. I would agree that passing just a simple "not found" is likely not a best behavior and may confuse people but crashing everyone, even those users who not yet logged in seem worse to me.
The text was updated successfully, but these errors were encountered: