jackwener/OpenCLI · error · CommandExecutionError
${result.detail}
Error message
${result.detail} What it means
subscribed.js throws CommandExecutionError(result.detail) when the page.evaluate result carries kind 'malformed', meaning the Reddit API response could not be parsed as the expected JSON shape (e.g. HTML/login-wall text instead of JSON, or missing data field). The CLI forwards the browser-side parse detail verbatim. It signals the response body did not match the subscribed-list schema.
Source
Thrown at clis/reddit/subscribed.js:151
return { kind: 'malformed', detail: 'Reddit subscriptions pagination exceeded the safety cap before satisfying the requested limit.' };
}
return { kind: 'ok', entries: out };
} catch (e) {
return { kind: 'exception', detail: String(e && e.message || e) };
}
})()`));
if (result?.kind === 'login-wall') {
// Convert the browser-side sentinel into a typed LoginWallError on the Node side.
throwIfLoginWall(result.sentinel, { url: result.where });
}
if (result?.kind === 'auth') {
throw new AuthRequiredError('reddit.com', result.detail);
}
if (result?.kind === 'http') {
throw new CommandExecutionError(`HTTP ${result.httpStatus} from ${result.where}`);
}
if (result?.kind === 'malformed') {
throw new CommandExecutionError(result.detail);
}
if (result?.kind === 'exception') {
throw new CommandExecutionError(`subscribed failed: ${result.detail}`);
}
if (result?.kind !== 'ok' || !Array.isArray(result.entries)) {
throw new CommandExecutionError(`Unexpected result from reddit subscribed: ${JSON.stringify(result)}`);
}
const rows = result.entries.slice(0, limit).map((entry, index) => mapSubredditRow(entry, index));
if (rows.length === 0) {
throw new EmptyResultError('Reddit returned no subscribed subreddits for the logged-in account.');
}
return rows;
}
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Open reddit.com in the attached browser and confirm pages render normally (clears challenge/interstitial states).
- Re-run the command once — transient proxy/CDN corruption is a common cause.
- Log in / refresh the session if the malformed body is actually a login page.
- Check network path (VPN, corporate proxy) that may inject or block content.
Defensive patterns
Strategy: try-catch
Try / catch
try {
await run(['reddit', 'subscribed']);
} catch (e) {
// 'malformed' detail indicates non-JSON response; log detail, retry once after browser check
console.error('Reddit returned non-JSON:', e.message);
} Prevention
- Resolve any anti-bot/challenge pages in the browser before scripting
- Avoid VPN/proxy paths that corrupt Reddit responses
- Retry once on transient malformed responses
- Verify logged-in state so Reddit returns JSON, not HTML login pages
When it happens
Trigger: Reddit returns non-JSON (HTML error page, challenge page, empty body) to the in-page fetch; result = {kind:'malformed', detail:...} is converted at subscribed.js:151.
Common situations: Reddit serving an anti-bot HTML interstitial; being logged out mid-request so an HTML page is returned; Reddit CDN/proxy errors returning markup; blocked or unusual network (VPN) altering responses.
Related errors
- Sales Navigator lead search API returned malformed payload
- Reddit subscriptions row ${index + 1} was missing data.
- Reddit subscriptions row ${index + 1} was missing subreddit
- Failed to parse 12306 station_name.js: source string not fou
- Failed to parse 12306 station_name.js: no station records fo
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/ef00cc1f18f01095.
Report an issue: GitHub.