From e52fe26709865473e1ea4a8bac542c51668770a0 Mon Sep 17 00:00:00 2001 From: Alex / KATT Date: Fri, 13 Oct 2023 02:23:21 +0200 Subject: [PATCH] fix: use error constructor params and spread them (#61) --- src/errors.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/errors.ts b/src/errors.ts index 41be0f2..9a69fc9 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -1,9 +1,6 @@ -// get constructor parameters of Error -type ErrorOptions = ConstructorParameters[1]; - export class TsonError extends Error { - constructor(message: string, opts?: ErrorOptions) { - super(message, opts); + constructor(...args: ConstructorParameters) { + super(...args); this.name = "TsonError"; } }