From a22c00fcefa10a99505c05393106fb3a655de243 Mon Sep 17 00:00:00 2001 From: Rory& Date: Sun, 1 Jun 2025 04:40:09 +0200 Subject: Add register with validation --- src/util/error.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/util/error.js') diff --git a/src/util/error.js b/src/util/error.js index 96f1deb..5fc454a 100644 --- a/src/util/error.js +++ b/src/util/error.js @@ -5,8 +5,9 @@ export class SafeNSoundError extends Error { this.errCode = options; super.message = this.getDefaultMessage(); } else if (typeof options === 'object') { - this.errCode = options.errCode || 'UNKNOWN_ERROR'; - super.message = options.message || this.getDefaultMessage(); + for (const key in options) { + this[key] = options[key]; + } } else { this.errCode = 'UNKNOWN_ERROR'; this.message = -- cgit 1.5.1