Problem
When a callback-style task fails, times out or is aborted, the queue emits error before invoking the task's callback. With no error listener attached, Node.js throws on the emit, so the process crashes and the callback never runs. A timeout example in the README did exactly that during verification (#50). A callback-API user handling errors in their callback shouldn't also need a queue-wide listener to stay alive.
Fix
Only emit error when a listener is attached (listenerCount("error") > 0), and always deliver the failure to the task's callback or promise. Test a failing, a timed-out and an aborted callback task with no error listener: no throw, and the callback receives the documented payload. Then drop the README caveat.
Problem
When a callback-style task fails, times out or is aborted, the queue emits
errorbefore invoking the task's callback. With noerrorlistener attached, Node.js throws on theemit, so the process crashes and the callback never runs. A timeout example in the README did exactly that during verification (#50). A callback-API user handling errors in their callback shouldn't also need a queue-wide listener to stay alive.Fix
Only emit
errorwhen a listener is attached (listenerCount("error") > 0), and always deliver the failure to the task's callback or promise. Test a failing, a timed-out and an aborted callback task with noerrorlistener: no throw, and the callback receives the documented payload. Then drop the README caveat.