/**
 * Thrown by BrowserHub when the resident browser hits a Cloudflare interactive
 * challenge that a human must clear. It is NOT a store failure to retry — it's a
 * prompt: SearchService turns it into a `needsSolve` outcome carrying `solveUrl`
 * (the noVNC page), which the UI opens so the user can tap through the challenge.
 *
 * Kept in its own tiny module (no puppeteer import) so SearchService can catch it
 * without pulling in the browser machinery. See WALLED-STORES.md.
 */
export class ChallengeRequiredError extends Error {
  constructor(
    public readonly storeId: string,
    public readonly solveUrl: string,
  ) {
    super(`${storeId}: a human must solve the Cloudflare challenge (${solveUrl})`);
    this.name = "ChallengeRequiredError";
  }
}
