Skip to content

Commit

Permalink
Emit error on correct stream
Browse files Browse the repository at this point in the history
This change fixes one of the issues from #98. `state.stream` can be the wrong stream to emit an error to if no path is passed however `ret` will always be the right stream to emit to. 

This makes it possible to listen for 'error' events although an error is still squelched if it's not listened for.
  • Loading branch information
KodeAndGame committed Sep 29, 2015
1 parent 46abded commit 488d5dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ function Xray() {
}

node(function(err) {
if (err) state.stream.emit('error', err);
if (err) ret.emit('error', err);
})

return ret;
Expand Down

0 comments on commit 488d5dd

Please sign in to comment.