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

Fix error handling in query()? #179

Closed
wants to merge 1 commit into from

Conversation

alxndrsn
Copy link

On updating to latest node-connect-pg-simple, I started seeing many UnhandledPromiseRejectionWarnings when running out of database connections.

Looking into the code, it seems like the query() function is throwing errors when they should be handled internally.

Is this a bug, or have I misunderstood what's going on?

If an error handler is provided, use it.  Otherwise propagate the Error up the
stack.

Prior to this, error handler was ignored, and all Errors caught in query() were
rethrown.
voxpelli added a commit that referenced this pull request Aug 19, 2020
voxpelli added a commit that referenced this pull request Aug 19, 2020
@voxpelli
Copy link
Owner

Thanks @alxndrsn!

I took a look at the history of the file and decided to revert the function to the state it was prior to refactoring, but many thanks for making a PR 🙏

I also added tests for this case, so it won't appear again.

@voxpelli voxpelli closed this Aug 19, 2020
@alxndrsn
Copy link
Author

Great, looks like it works - thanks for the quick fix & new release!

@alxndrsn alxndrsn deleted the remove-unused-argument branch August 20, 2020 10:19
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

Successfully merging this pull request may close these issues.

2 participants