diff --git a/src/boxerror.js b/src/boxerror.js index 530c8cd06..96e13cbab 100644 --- a/src/boxerror.js +++ b/src/boxerror.js @@ -74,7 +74,11 @@ BoxError.TIMEOUT = 'Timeout'; BoxError.TRY_AGAIN = 'Try Again'; BoxError.prototype.toPlainObject = function () { - return Object.assign({}, { message: this.message, reason: this.reason }, this.details); + return { + message: this.message, + reason: this.reason, + details: this.details + }; }; // this is a class method for now in case error is not a BoxError