jackwener/OpenCLI · error · CliError
PARSE_ERROR
PARSE_ERROR
Error message
Bloomberg page did not expose article story data (${result.errorCode}) What it means
Thrown when the loaded Bloomberg page does not expose the expected story data and reports a page-side errorCode other than ROBOT_PAGE. The library only supports standard story/article pages that expose __NEXT_DATA__; anything else fails as PARSE_ERROR. It indicates the URL or page type is unsupported rather than a network failure.
Source
Thrown at clis/bloomberg/news.js:88
lede: story.lede || null,
ledeImageUrl: story.ledeImageUrl || null,
socialImageUrl: story.socialImageUrl || null,
imageAttachments: story.imageAttachments || {},
videoAttachments: story.videoAttachments || {},
}
};
})()`);
let result = await loadStory();
// Retry once — Bloomberg pages sometimes hydrate slowly.
if (result?.errorCode === 'NO_NEXT_DATA' || result?.errorCode === 'NO_STORY') {
await page.wait(4);
result = await loadStory();
}
if (result?.errorCode === 'ROBOT_PAGE') {
throw new CliError('FETCH_ERROR', 'Bloomberg served the bot-protection page instead of article content', 'Try again later or open the article in a regular Chrome session first, then rerun the command. This command uses your current Bloomberg access and does not bypass paywall or entitlement checks.');
}
if (result?.errorCode) {
throw new CliError('PARSE_ERROR', `Bloomberg page did not expose article story data (${result.errorCode})`, 'This command currently works on standard Bloomberg story/article pages that expose __NEXT_DATA__. Audio, video, newsletter, or other non-standard/blocked pages may not work. Access still depends on your current Bloomberg session.');
}
const story = result?.story;
if (!story) {
throw new CliError('PARSE_ERROR', 'Failed to extract Bloomberg story data', 'Bloomberg may have changed the page structure.');
}
const content = renderStoryBody(story.body);
if (!content) {
throw new CliError('PARSE_ERROR', 'Bloomberg article body was empty after parsing', 'Bloomberg may have changed the story-body format, the URL may not point to a standard article page, or the page may not be accessible in your current Bloomberg session.');
}
return [{
title: story.headline || '',
summary: story.summary || '',
link: story.url || url,
mediaLinks: extractStoryMediaLinks(story),
content,
}];
},
});View on GitHub (pinned to 49907e53dc)
Solutions
- Confirm the URL points to a standard bloomberg.com news/story article page
- Retry once — the command already retries slow-hydrating pages automatically
- Check that your Bloomberg session allows access to the article (no entitlement wall)
- Update the library if Bloomberg changed its page template/next-data shape
Example fix
// before
await news.getArticle('https://www.bloomberg.com/audio/episode-123');
// after
const url = 'https://www.bloomberg.com/news/articles/2024-01-01/story-slug'; // standard article URL
const story = await news.getArticle(url); Defensive patterns
Strategy: validation
Validate before calling
function isStandardArticleUrl(url) {
try {
const u = new URL(url);
return /(^|\.)bloomberg\.com$/.test(u.hostname)
&& u.pathname.startsWith('/news/articles/');
} catch { return false; }
} Type guard
null
Try / catch
try {
const story = await news.getArticle(url);
} catch (e) {
if (e.code === 'PARSE_ERROR' && /did not expose article story data/.test(e.message)) {
// unsupported page type; skip or surface message to user
}
} Prevention
- Only pass standard /news/articles/ story URLs
- Avoid audio, video, and newsletter page URLs
- Check the page exposes __NEXT_DATA__ if debugging
When it happens
Trigger: Calling a Bloomberg news command with a URL that resolves to a non-standard page (audio, video, newsletter, live blog) or one whose __NEXT_DATA__ is missing/unparseable — result.errorCode set to values like NO_NEXT_DATA persisting after retry.
Common situations: Passing a Bloomberg audio/podcast or video page URL; Bloomberg serving a new page template without __NEXT_DATA__; a redirect to a hub/index page instead of an article.
Related errors
- Barchart greeks returned an unreadable options payload${data
- PARSE_ERROR
- NOT_FOUND
- FETCH_ERROR
- ${command} parser returned an unexpected shape
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/8347842c83316219.
Report an issue: GitHub.