import { ServiceError } from './service-error.js';

export class BadRequestError extends ServiceError {
  constructor(message = 'Bad request', details?: Record<string, unknown>) {
    super(400, message, details);
  }
}

export class UnauthorizedError extends ServiceError {
  constructor(message = 'Unauthorized', details?: Record<string, unknown>) {
    super(401, message, details);
  }
}

export class ForbiddenError extends ServiceError {
  constructor(message = 'Forbidden', details?: Record<string, unknown>) {
    super(403, message, details);
  }
}

export class NotFoundError extends ServiceError {
  constructor(message = 'Not found', details?: Record<string, unknown>) {
    super(404, message, details);
  }
}

export class ConflictError extends ServiceError {
  constructor(message = 'Conflict', details?: Record<string, unknown>) {
    super(409, message, details);
  }
}

export class TooManyRequestsError extends ServiceError {
  constructor(message = 'Too many requests', details?: Record<string, unknown>) {
    super(429, message, details);
  }
}
