-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Labels
Description
While using the 'message' event to process an incoming message on a worker I noticed that the worker was throwing an 'error' event on every single message but I was not getting anything in the error object.
After many hours I realized that the problem was within one of my functions processing said messages, but I couldn't realize from where since the exception thrown what getting lost.
I'm not sure if this is something you should fix or if I should just encapsulate all my code within try {} catch {} blocks.
i.e:
inboundQueueWorker.on('message', function(message, next, msgid) {
try {
...
next();
} catch (e) {
next(e)
}
});
I'd be interested to hear your opinion on this.