Merge pull request #67 from TriliumNext/fix/EtapiError-prototype

fix: set prototype
This commit is contained in:
Elian Doran 2024-05-08 21:37:36 +03:00 committed by GitHub
commit ade6d08ded
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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