From 5f539427a943382d7d40a8db76095e07dfe5e96e Mon Sep 17 00:00:00 2001 From: Alex <54153428+alexpietsch@users.noreply.github.com> Date: Sun, 5 May 2024 12:40:00 +0200 Subject: [PATCH] fix: set prototype --- src/etapi/etapi_utils.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/etapi/etapi_utils.ts b/src/etapi/etapi_utils.ts index bcb589325..3498a8257 100644 --- a/src/etapi/etapi_utils.ts +++ b/src/etapi/etapi_utils.ts @@ -17,11 +17,13 @@ class EtapiError extends Error { code: string; constructor(statusCode: number, code: string, message: string) { - super(); + super(message); + + // Set the prototype explicitly. + Object.setPrototypeOf(this, EtapiError.prototype); this.statusCode = statusCode; this.code = code; - this.message = message; } }