add auth and user handling

This commit is contained in:
Anika Raemer 2025-09-21 19:49:54 +02:00
parent db057ce342
commit 1fce467571
19 changed files with 356 additions and 32 deletions

39
src/errors/httpErrors.ts Normal file
View file

@ -0,0 +1,39 @@
export class ValidationError extends Error {
statusCode = 400;
constructor(message: string) {
super(message);
this.name = "ValidationError";
}
}
export class NotFoundError extends Error {
statusCode = 404;
constructor(message: string) {
super(message);
this.name = "NotFoundError";
}
}
export class ConflictError extends Error {
statusCode = 409;
constructor(message: string) {
super(message);
this.name = "ConflictError";
}
}
export class InternalServerError extends Error {
statusCode = 500;
constructor(message: string) {
super(message);
this.name = "InternalServerError";
}
}
export class UnauthorizedError extends Error {
statusCode = 409;
constructor(message: string) {
super(message);
this.name = "UnauthorizedError";
}
}