Skip to content

Build your personal knowledge base with Trilium Notes

fix: set prototype

Alex5f539427a943
diff --git a/src/etapi/etapi_utils.ts b/src/etapi/etapi_utils.ts
index bcb589325d..3498a8257f 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;
}
}