mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 16:55:50 +01:00
chore(monorepo/server): move server-side source code
This commit is contained in:
12
apps/server/src/errors/forbidden_error.ts
Normal file
12
apps/server/src/errors/forbidden_error.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import HttpError from "./http_error.js";
|
||||
|
||||
class ForbiddenError extends HttpError {
|
||||
|
||||
constructor(message: string) {
|
||||
super(message, 403);
|
||||
this.name = "ForbiddenError";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default ForbiddenError;
|
||||
13
apps/server/src/errors/http_error.ts
Normal file
13
apps/server/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;
|
||||
12
apps/server/src/errors/not_found_error.ts
Normal file
12
apps/server/src/errors/not_found_error.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import HttpError from "./http_error.js";
|
||||
|
||||
class NotFoundError extends HttpError {
|
||||
|
||||
constructor(message: string) {
|
||||
super(message, 404);
|
||||
this.name = "NotFoundError";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default NotFoundError;
|
||||
9
apps/server/src/errors/open_id_error.ts
Normal file
9
apps/server/src/errors/open_id_error.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
class OpenIdError {
|
||||
message: string;
|
||||
|
||||
constructor(message: string) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
|
||||
export default OpenIdError;
|
||||
12
apps/server/src/errors/validation_error.ts
Normal file
12
apps/server/src/errors/validation_error.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import HttpError from "./http_error.js";
|
||||
|
||||
class ValidationError extends HttpError {
|
||||
|
||||
constructor(message: string) {
|
||||
super(message, 400)
|
||||
this.name = "ValidationError";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default ValidationError;
|
||||
Reference in New Issue
Block a user