Gracefully handling connections errors...
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 238
- PR merge metrics
- No merged PRs in 30d
Description
Maybe I'm missing something, but since the instantiation of the Schema class automatically does the connect behind the scenes without a callback, there is no way to gracefully handle connection errors.
Most other ORMs seem to provide a connect function with a callback that passes back an err object, as is the case when you perform a find operation with JugglingDB. If for some reason the server is unable to connect I want to gracefully handle the error and not kill the process. I could use Node's domains to catch the error, but it would be so much simpler to just have a callback. I see there is an event emitted when JugglingDB has connected, but other than that, what am I supposed to do? I rather like the this ORM (minus the thorough documentation), but this seems like a simple thing thats missing?
Contributor guide
No contributing guide indexed for this repository
Research direction
Look at the Schema class instantiation code to see where the connection is made. Identify how other ORMs handle connection errors with callbacks. Check for existing connection events in the codebase. The goal is to add a callback parameter or event listener for connection errors without breaking existing functionality.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100