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
- Check network connectivity/proxy settings and retry the command.
- Verify the game URL parses to a valid kind/id by opening the analysis URL manually in a normal browser.
- Retry after a delay if Chess.com is rate-limiting; add a real User-Agent/session to reduce bot blocking.
- 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
- Validate game URLs before navigation
- Retry navigation once on transient network errors
- Run with a working network/proxy config reachable to chess.com
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
- Failed to load Booking.com search page: ${err?.message || er
- coupang search filtered navigation failed: ${error?.message
- Failed to open Youdao Note URL: ${error instanceof Error ? e
- Failed to open Zhihu answer ${answerId}: ${err instanceof Er
- Barchart greeks request failed: ${data.message || 'unknown e
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/29d3ed2612dea624.
Report an issue: GitHub.