chore: update gitignore for phase02

This commit is contained in:
hibna
2026-02-21 13:22:51 +03:00
parent 2215003a4d
commit 8eb7c90958
16 changed files with 479 additions and 29 deletions
+30
View File
@@ -0,0 +1,30 @@
export class AppError extends Error {
constructor(
public statusCode: number,
message: string,
public code?: string,
) {
super(message);
this.name = 'AppError';
}
static badRequest(message: string, code?: string) {
return new AppError(400, message, code);
}
static unauthorized(message = 'Unauthorized', code?: string) {
return new AppError(401, message, code);
}
static forbidden(message = 'Forbidden', code?: string) {
return new AppError(403, message, code);
}
static notFound(message = 'Not found', code?: string) {
return new AppError(404, message, code);
}
static conflict(message: string, code?: string) {
return new AppError(409, message, code);
}
}