boxerror: remove usage of Object.assign

This commit is contained in:
Girish Ramakrishnan
2025-07-18 19:33:34 +02:00
parent a684fadf43
commit 5d8871a044
+5 -1
View File
@@ -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