// errors.js export class ApiError extends Error { constructor(message, status = 500, code = 'INTERNAL_SERVER_ERROR') { super(message); this.status = status; this.code = code; } } export class ValidationError extends ApiError { constructor(message) { super(message, 400, 'VALIDATION_ERROR'); } } export class AuthenticationError extends ApiError { constructor(message = 'Unauthorized') { super(message, 401, 'AUTHENTICATION_ERROR'); } }