Catch and save Bad Mac errors on the incoming message model

This commit is contained in:
lilia 2014-12-23 15:33:35 -08:00
parent 40b54185f3
commit 0292c12712

View file

@ -96,7 +96,12 @@
message.save({ errors : [e] }).then(function() {
extension.trigger('message', message); // notify frontend listeners
});
} else if (e.message === 'Bad MAC') {
message.save({ errors : [ _.pick(e, ['name', 'message'])]}).then(function() {
extension.trigger('message', message); // notify frontend listeners
});
} else {
console.log(e);
throw e;
}
});