Skip to content

Commit

Permalink
[fix] put the error handler into its own function
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrugzz committed May 26, 2013
1 parent e55fa46 commit bf44372
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/godot/reactor/reactor.js
Expand Up @@ -63,8 +63,12 @@ Reactor.prototype.createStream = function (source) {
return wrap;
}

function handleError(err) {
console.log(err);
}

return this.reactors.reduce(function (last, nextOptions) {
last.on('error', function (err) { console.log(err) });
last.on('error', handleError);
return last.pipe(
wrapStream(nextOptions.Factory, nextOptions.args || [])
);
Expand Down

0 comments on commit bf44372

Please sign in to comment.