Ensure errors in node.receive are handled

This commit is contained in:
Nick O'Leary
2015-05-02 22:15:33 +01:00
parent 0c5c3448d0
commit 51fce9343b
2 changed files with 19 additions and 1 deletions

View File

@@ -193,7 +193,11 @@ Node.prototype.receive = function(msg) {
msg._msgid = constructUniqueIdentifier();
}
this.metric("receive",msg);
this.emit("input", msg);
try {
this.emit("input", msg);
} catch(err) {
this.error(err,msg);
}
};
function log_helper(self, level, msg) {