Save all errors
But clean up objects created by the Error constructor, as they contain non-serializable properties, like functions. // FREEBIE
This commit is contained in:
@@ -144,14 +144,12 @@
|
|||||||
console.log(e);
|
console.log(e);
|
||||||
console.log(e.reason, e.stack);
|
console.log(e.reason, e.stack);
|
||||||
});
|
});
|
||||||
message.save({
|
this.save({
|
||||||
errors : errors.filter(function(e) {
|
errors : errors.map(function(e) {
|
||||||
switch(e.name) {
|
if (e.constructor === Error) {
|
||||||
case 'OutgoingIdentityKeyError':
|
return _.pick(e, 'name', 'message', 'number', 'reason');
|
||||||
case 'HTTPError':
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
return e;
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
Reference in New Issue
Block a user