-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
Event handler for 'error' #171
Comments
@drmrbrewer just ran into the same thing. I ended up adding an empty const queue = new PQueue({concurrency: 2});
queue.on('error', error => {
console.error(error);
});
queue.add(() => Promise.reject(new Error('error'))).catch(() => { /* handled in event callback */ }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The example given for the error event is as follows:
But as noted here:
The
error
event handler example above doesn't follow this guidance, and throws an exception that isn't handled, crashing the node app, so that the event handler is sadly never called.So we must add an error handler on the item to catch the error... but in which case what use does the
error
event handler have?The text was updated successfully, but these errors were encountered: