jackwener/OpenCLI · error · CommandExecutionError
HTTP ${result.httpStatus} from ${result.where}
Error message
HTTP ${result.httpStatus} from ${result.where} What it means
When the browser-side probe reports {kind:'http', httpStatus, where}, subscribed.js throws CommandExecutionError with `HTTP ${result.httpStatus} from ${result.where}`. It means the Reddit API endpoint responded with a non-2xx HTTP status while fetching the subscribed list. The library converts raw HTTP failures into a uniform CLI error carrying the status and URL.
Source
Thrown at clis/reddit/subscribed.js:148
after = next;
}
if (out.length < target && after) {
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
- Read the status in the message: 403 -> open reddit.com in the attached browser and complete any challenge/verify login; 429 -> wait and back off; 404/5xx -> check whether the Reddit endpoint changed.
- Reduce call frequency or add retry with exponential backoff around the command.
- Ensure the attached browser profile has normal user-agent/cookies (avoid detection-triggering setups).
- Catch CommandExecutionError and inspect the HTTP status before deciding to retry or abort.
Example fix
// before
await run(['reddit', 'subscribed']); // throws HTTP 429 from https://www.reddit.com/...
// after
for (let attempt = 0; attempt < 3; attempt++) {
try { return await run(['reddit', 'subscribed']); }
catch (e) {
if (!/HTTP 429/.test(String(e.message))) throw e;
await new Promise(r => setTimeout(r, 2 ** attempt * 5000));
}
} Defensive patterns
Strategy: retry
Try / catch
try {
await run(['reddit', 'subscribed']);
} catch (e) {
const m = /HTTP (\d{3}) from (.+)/.exec(e.message);
if (m && (m[1] === '429' || m[1].startsWith('5'))) {
await sleep(backoff(attempt)); // retry with exponential backoff
} else throw e;
} Prevention
- Throttle reddit CLI calls to avoid 429 rate limiting
- Add exponential backoff retries around 429/5xx responses
- Use a normal browser profile (avoid proxy setups that trigger 403)
- Monitor message text for status codes to classify failures
When it happens
Trigger: The in-page fetch to reddit.com subscribed endpoints returns 403/429/5xx; e.g. Reddit blocks the request, rate-limits the account, or the endpoint path changed and returns 404.
Common situations: Reddit rate limiting after rapid repeated CLI calls; 403 from Reddit's anti-bot/proxy detection; 404 after a Reddit API change; transient 5xx server errors.
Understand the failure class
Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.
Related errors
- HTTP ${result.httpStatus} from /api/me.json
- HTTP ${result.httpStatus} from ${result.where}
- autohome ${contextHint} HTTP ${resp.status}
- Chess.com callback returned HTTP ${resp.status} for ${url}
- Ctrip flight API returned HTTP ${status || 'unknown'}
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/553fafbaa5845517.
Report an issue: GitHub.