export class UserError extends Error {
  statusCode: number

  constructor(message: string, statusCode: number) {
    super(message)
    this.name = "UserError"
    this.statusCode = statusCode
  }
}

export class NotFoundError extends UserError {
  constructor(message = "Resource not found") {
    super(message, 404)
  }
}

export class UnauthorizedError extends UserError {
  constructor(message = "Unauthorized access") {
    super(message, 401)
  }
}

export class ForbiddenError extends UserError {
  constructor(message = "Access forbidden") {
    super(message, 403)
  }
}

export class ConflictError extends UserError {
  constructor(message = "Conflict detected") {
    super(message, 409)
  }
}
