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:
parent
6e1a41e9cf
commit
363c436b33
1 changed files with 3 additions and 0 deletions
|
@ -100,6 +100,9 @@
|
||||||
message.unset('pending');
|
message.unset('pending');
|
||||||
message.save();
|
message.save();
|
||||||
}.bind(this)).catch(function(errors) {
|
}.bind(this)).catch(function(errors) {
|
||||||
|
if (errors instanceof Error) {
|
||||||
|
errors = [errors];
|
||||||
|
}
|
||||||
var keyErrors = [];
|
var keyErrors = [];
|
||||||
_.each(errors, function(e) {
|
_.each(errors, function(e) {
|
||||||
if (e.error.name === 'OutgoingIdentityKeyError') {
|
if (e.error.name === 'OutgoingIdentityKeyError') {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue