Handle single-error rejections when sending messages

We can not assume that we will get back an error array.

Closes #258 // FREEBIE
This commit is contained in:
lilia 2015-06-05 17:13:18 -07:00
parent 6e1a41e9cf
commit 363c436b33

View file

@ -100,6 +100,9 @@
message.unset('pending');
message.save();
}.bind(this)).catch(function(errors) {
if (errors instanceof Error) {
errors = [errors];
}
var keyErrors = [];
_.each(errors, function(e) {
if (e.error.name === 'OutgoingIdentityKeyError') {