mirror of
https://github.com/zadam/trilium.git
synced 2025-11-14 01:05:49 +01:00
refactor(errors): add HttpError class and extend existing errors from it
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
class ValidationError extends Error {
|
||||
statusCode: number;
|
||||
import HttpError from "./http_error.js";
|
||||
|
||||
class ValidationError extends HttpError {
|
||||
|
||||
constructor(message: string) {
|
||||
super(message)
|
||||
super(message, 400)
|
||||
this.name = "ValidationError";
|
||||
this.statusCode = 400;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user