jackwener/OpenCLI · error · CommandExecutionError

Failed to open Chess.com analysis board: ${error?.message ||

Error message

Failed to open Chess.com analysis board: ${error?.message || error}

What it means

When navigating to the Chess.com analysis board (page.goto + wait) fails, the underlying error is wrapped in a CommandExecutionError with this message so the caller knows the analysis page could not be opened, preserving the original error text.

Source

Thrown at clis/chess/analyze.js:31

    access: 'read',
    description: 'Open a Chess.com game in the browser analysis board',
    domain: 'www.chess.com',
    strategy: Strategy.UI,
    browser: true,
    navigateBefore: false,
    args: [
        { name: 'game-url', type: 'string', required: true, positional: true, help: 'Full game URL, e.g. https://www.chess.com/game/live/168842570216' },
    ],
    columns: ['kind', 'game_id', 'analysis_url'],
    func: async (page, kwargs) => {
        if (!page) throw new CommandExecutionError('Browser session required for chess analyze');
        const { kind, id } = parseGameUrl(kwargs['game-url']);
        const analysisUrl = `https://www.chess.com/analysis/game/${kind}/${id}`;
        try {
            await page.goto(analysisUrl);
            await page.wait(2);
        } catch (error) {
            throw new CommandExecutionError(`Failed to open Chess.com analysis board: ${error?.message || error}`);
        }
        return [{ kind, game_id: id, analysis_url: analysisUrl }];
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Check network connectivity/proxy settings and retry the command.
  2. Verify the game URL parses to a valid kind/id by opening the analysis URL manually in a normal browser.
  3. Retry after a delay if Chess.com is rate-limiting; add a real User-Agent/session to reduce bot blocking.
  4. Confirm the game still exists on Chess.com (deleted/private games can fail).

Example fix

// before
await page.goto(analysisUrl); // may throw raw net error
// after
try { await page.goto(analysisUrl); await page.wait(2); }
catch (error) { throw new CommandExecutionError(`Failed to open Chess.com analysis board: ${error?.message || error}`); }
Defensive patterns

Strategy: try-catch

Validate before calling

const url = new URL(gameUrl);
if (!/chess\.com$/.test(url.hostname)) throw new Error('Not a chess.com game URL');

Type guard

null

Try / catch

try {
  await page.goto(analysisUrl);
  await page.wait(2);
} catch (error) {
  // inspect error.message: 'net::' => network, 'timeout' => slow load
  console.error(`Failed to open analysis board: ${error?.message || error}`);
  // retry once or surface to user
}

Prevention

When it happens

Trigger: page.goto('https://www.chess.com/analysis/game/<kind>/<id>') throws — network failure, DNS error, Chess.com returning 5xx/403, timeout, or an invalid navigation in the browser session.

Common situations: No internet or corporate proxy blocking chess.com; Chess.com rate-limiting or bot-blocking the automated browser; malformed game URL producing a 404-ish page that breaks goto; transient network blips mid-run.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/29d3ed2612dea624. Report an issue: GitHub.