Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Throw real error; don't wrap emit('_data') w/try/catch
  • Loading branch information
CrabBot committed Aug 7, 2012
1 parent 78bd918 commit afa11a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/parser.js
Expand Up @@ -38,10 +38,10 @@ Parser.prototype.receive = function receive(buffer) {
if (json.length > 0) {
try {
json = JSON.parse(json);
this.emit('_data', json);
} catch (error) {
this.emit('error', json);
this.emit('error', new Error('Invalid JSON - ', error.message));
}
this.emit('_data', json);
}
}
};
Expand Down

0 comments on commit afa11a1

Please sign in to comment.