export class HttpError extends Error { constructor( public status: number, message: string, public code?: string, ) { super(message); this.name = "HttpError"; } } export class AuthError extends HttpError { constructor(message: string = "Authentication required") { super(401, message, "AUTH_ERROR"); } } export class AuthorizationError extends HttpError { constructor(message: string = "Insufficient permissions") { super(403, message, "AUTHORIZATION_ERROR"); } } export class NotFoundError extends HttpError { constructor(message: string = "Resource not found") { super(404, message, "NOT_FOUND"); } } export class ValidationError extends HttpError { constructor(message: string = "Validation failed") { super(400, message, "VALIDATION_ERROR"); } }