mirror of
https://github.com/zadam/trilium.git
synced 2025-11-14 09:15:50 +01:00
refactor(errors): add HttpError class and extend existing errors from it
This commit is contained in:
13
src/errors/http_error.ts
Normal file
13
src/errors/http_error.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
class HttpError extends Error {
|
||||
|
||||
statusCode: number;
|
||||
|
||||
constructor(message: string, statusCode: number) {
|
||||
super(message);
|
||||
this.name = "HttpError";
|
||||
this.statusCode = statusCode;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default HttpError;
|
||||
Reference in New Issue
Block a user