{"record":{"id":"8347842c83316219","repo":"jackwener/OpenCLI","slug":"parse-error-834784","errorCode":"PARSE_ERROR","errorMessage":"Bloomberg page did not expose article story data (${result.errorCode})","messagePattern":"Bloomberg page did not expose article story data \\((.+?)\\)","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"error","filePath":"clis/bloomberg/news.js","lineNumber":88,"sourceCode":"          lede: story.lede || null,\n          ledeImageUrl: story.ledeImageUrl || null,\n          socialImageUrl: story.socialImageUrl || null,\n          imageAttachments: story.imageAttachments || {},\n          videoAttachments: story.videoAttachments || {},\n        }\n      };\n    })()`);\n        let result = await loadStory();\n        // Retry once — Bloomberg pages sometimes hydrate slowly.\n        if (result?.errorCode === 'NO_NEXT_DATA' || result?.errorCode === 'NO_STORY') {\n            await page.wait(4);\n            result = await loadStory();\n        }\n        if (result?.errorCode === 'ROBOT_PAGE') {\n            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.');\n        }\n        if (result?.errorCode) {\n            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.');\n        }\n        const story = result?.story;\n        if (!story) {\n            throw new CliError('PARSE_ERROR', 'Failed to extract Bloomberg story data', 'Bloomberg may have changed the page structure.');\n        }\n        const content = renderStoryBody(story.body);\n        if (!content) {\n            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.');\n        }\n        return [{\n                title: story.headline || '',\n                summary: story.summary || '',\n                link: story.url || url,\n                mediaLinks: extractStoryMediaLinks(story),\n                content,\n            }];\n    },\n});","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/bloomberg/news.js#L70-L106","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nawait news.getArticle('https://www.bloomberg.com/audio/episode-123');\n// after\nconst url = 'https://www.bloomberg.com/news/articles/2024-01-01/story-slug'; // standard article URL\nconst story = await news.getArticle(url);","handlingStrategy":"validation","validationCode":"function isStandardArticleUrl(url) {\n  try {\n    const u = new URL(url);\n    return /(^|\\.)bloomberg\\.com$/.test(u.hostname)\n      && u.pathname.startsWith('/news/articles/');\n  } catch { return false; }\n}","typeGuard":"null","tryCatchPattern":"try {\n  const story = await news.getArticle(url);\n} catch (e) {\n  if (e.code === 'PARSE_ERROR' && /did not expose article story data/.test(e.message)) {\n    // unsupported page type; skip or surface message to user\n  }\n}","preventionTips":["Only pass standard /news/articles/ story URLs","Avoid audio, video, and newsletter page URLs","Check the page exposes __NEXT_DATA__ if debugging"],"tags":["scraping","parsing","bloomberg"],"backgroundTag":"unsupported-page-type","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}