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:
parent
37ff3cf5a8
commit
c1b9f3235f
1 changed files with 5 additions and 7 deletions
|
@ -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));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue