diff --git a/lib/pluginRunner.js b/lib/pluginRunner.js index c7cddedc..03e9fe50 100644 --- a/lib/pluginRunner.js +++ b/lib/pluginRunner.js @@ -3,7 +3,7 @@ var runPlugin = function(self, pluginRefrence, type, func, queue, job, args, cal if(!job){ callback(null, true); }else{ - + var pluginName = pluginRefrence; if(typeof pluginRefrence === 'function'){ pluginName = new pluginRefrence(self, func, queue, job, args, {}).name; @@ -25,7 +25,7 @@ var runPlugin = function(self, pluginRefrence, type, func, queue, job, args, cal } else { throw new Error('Plugin must be the constructor name or an object'); } - + if(plugin[type] === null || plugin[type] === undefined || typeof plugin[type] !== 'function'){ callback(null, true); }else{ @@ -49,7 +49,9 @@ var runPlugins = function(self, type, func, queue, job, args, callback, pluginCo var pluginRefrence = job.plugins[pluginCounter]; runPlugin(self, pluginRefrence, type, func, queue, job, args, function(err, toRun){ pluginCounter++; - if(toRun === false){ + if(err){ + callback(err, toRun); + }else if(toRun === false){ callback(err, false); }else{ runPlugins(self, type, func, queue, job, args, callback, pluginCounter); diff --git a/package.json b/package.json index a4848066..85577e7e 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "name": "node-resque", "description": "an opinionated implementation of resque in node", "license": "Apache-2.0", - "version": "2.0.2", + "version": "2.0.3", "homepage": "http://github.com/taskrabbit/node-resque", "repository": { "type": "git",