From e673f82a2fd2283d00ddff54766e449772764c49 Mon Sep 17 00:00:00 2001 From: KATT Date: Fri, 13 Oct 2023 02:20:58 +0200 Subject: [PATCH] fix: use error constructor params and spread them --- 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"; } }