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

query error behavior #21

Closed
piscisaureus opened this issue Sep 29, 2010 · 3 comments
Closed

query error behavior #21

piscisaureus opened this issue Sep 29, 2010 · 3 comments

Comments

@piscisaureus
Copy link

According to the readme, the client's 'error' event is emitted when a query has no callback / delegate for an error.

This works fine for queries that have been created with a callback. However if a delegate is attached through client.on('error', cb), the client's error event is emitted anyway.

Try:

query = client.query('this must be wrong');
query.on('error', function(err) {
  console.log('Failing gracefully: ' + error);
});
@piscisaureus
Copy link
Author

Should be fairly easy to fix by checking if query.listeners('error').length > 1, and not throwing if that is the case.

@piscisaureus
Copy link
Author

@felixge
Copy link
Collaborator

felixge commented Oct 14, 2010

Landed in db328a1 and e3bc7db. Improved test added in ffdc745.

Thanks for the patch!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants