Permalink
Browse files

Catch errors in run(), closes #107

  • Loading branch information...
1 parent e43296d commit 3b2d36f55169b8e3f53d1778ef30346af59e2fbb @chriso chriso committed Jun 22, 2012
Showing with 9 additions and 5 deletions.
  1. +8 −4 lib/node.io/process_worker.js
  2. +1 −1 package.json
@@ -249,10 +249,14 @@ Processor.prototype.setupWorkerEvents = function (job, master) {
}, job.options.timeout * 1000);
}
- //Start the instance
- var ret = instance.run(instance.assigned_input);
- if (typeof ret !== 'undefined' && ret !== null) {
- instance.emit(ret);
+ try {
+ //Start the instance
+ var ret = instance.run(instance.assigned_input);
+ if (typeof ret !== 'undefined' && ret !== null) {
+ instance.emit(ret);
+ }
+ } catch (err) {
+ instance.fail_with(err);
}
job.instances++;
View
@@ -1,6 +1,6 @@
{ "name" : "node.io",
"description" : "A distributed data scraping and processing framework",
- "version" : "0.4.11",
+ "version" : "0.4.12",
"homepage" : "http://github.com/chriso/node.io",
"keywords" : ["data","mapreduce","map","reduce","scraping","html","parsing","parse","scrape","process","processing","data"],
"author" : "Chris O'Hara <cohara87@gmail.com>",

0 comments on commit 3b2d36f

Please sign in to comment.