fix: set prototype

This commit is contained in:
Alex 2024-05-05 12:40:00 +02:00
parent a68b75f069
commit 5f539427a9

View File

@ -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;
}
}