From eb3796a698e48d10b83b7b54a89f35110845cd56 Mon Sep 17 00:00:00 2001 From: Operations Research Engineering Software+ Date: Sun, 3 Jun 2018 14:08:26 -0700 Subject: [PATCH] need to demonstrate error cb not just drain cb need to demonstrate to users how to use a single error callback --- lib/queue.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/queue.js b/lib/queue.js index 2ba1747b3..7a201c44e 100644 --- a/lib/queue.js +++ b/lib/queue.js @@ -88,6 +88,11 @@ import wrapAsync from './internal/wrapAsync'; * console.log('all items have been processed'); * }; * + * // assign an error callback + * q.error = function(err, task) { + * console.error('task experienced an error'); + * }; + * * // add some items to the queue * q.push({name: 'foo'}, function(err) { * console.log('finished processing foo');