{"record":{"id":"d03a6a5358f495e4","repo":"jackwener/OpenCLI","slug":"not-found-d03a6a","errorCode":"NOT_FOUND","errorMessage":"No Bloomberg Businessweek stories found","messagePattern":"No Bloomberg Businessweek stories found","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"warning","filePath":"clis/bloomberg/businessweek.js","lineNumber":114,"sourceCode":"      const stories = extractBusinessweekStoriesFromNextData(data);\n      if (!stories) return { ok: false, error: 'NO_MODULES' };\n      return { ok: true, stories };\n    })()`);\n        let result = await loadStories();\n        // Next.js sometimes hydrates slowly — retry once before giving up.\n        if (result && result.ok === false && (result.error === 'NO_NEXT_DATA' || result.error === 'NO_MODULES')) {\n            await page.wait(4);\n            result = await loadStories();\n        }\n        if (!result || typeof result !== 'object') {\n            throw new CliError('PARSE_ERROR', 'Bloomberg Businessweek page returned malformed story data', 'Bloomberg may have changed the page structure.');\n        }\n        if (result.ok === false) {\n            throw new CliError('PARSE_ERROR', `Bloomberg Businessweek page did not expose story data (${result.error})`, 'Bloomberg may have changed the page structure.');\n        }\n        const stories = Array.isArray(result.stories) ? result.stories : [];\n        if (!stories.length) {\n            throw new CliError('NOT_FOUND', 'No Bloomberg Businessweek stories found', 'Bloomberg may have changed the page structure.');\n        }\n        return stories.slice(0, count);\n    },\n});\n\nexport const __test__ = {\n    command,\n    parseBusinessweekLimit,\n    normalizeBusinessweekStoryPath,\n    extractBusinessweekStoriesFromNextData,\n};\n","sourceCodeStart":96,"sourceCodeEnd":126,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/bloomberg/businessweek.js#L96-L126","documentation":"Thrown when the Businessweek page parsed successfully but produced a non-array or empty stories list. The library treats 'no stories extracted' as NOT_FOUND rather than a parse failure, since the page may legitimately have no stories accessible. Usually indicates the expected story nodes were missing from the fetched page.","triggerScenarios":"Calling the Businessweek stories command when result.stories is absent or an empty array — e.g. page rendered an empty shell, all stories are paywalled/hidden, or the selector for story items no longer matches.","commonSituations":"Hitting the page before its data hydrates; Bloomberg serving a consent/region interstitial; requesting a count larger than available stories; page redesign removing the story list.","solutions":["Retry the command — the page may not have hydrated on the first load","Verify in a browser that bloomberg.com/businessweek currently lists stories","Check that no consent-wall or region redirect is intercepting the page","Update the library to a version compatible with the current page markup"],"exampleFix":"// before\nconst stories = await bw.getStories(20);\n// after\nlet stories = [];\nfor (let i = 0; i < 3 && !stories.length; i++) {\n  await new Promise(r => setTimeout(r, 1000 * i));\n  stories = await bw.getStories(20);\n}","handlingStrategy":"retry","validationCode":"null","typeGuard":"function hasStories(r) {\n  return r && Array.isArray(r.stories) && r.stories.length > 0;\n}","tryCatchPattern":"try {\n  const stories = await bw.getStories();\n} catch (e) {\n  if (e.code === 'NOT_FOUND') {\n    // back off and retry; verify page in browser if it persists\n  }\n}","preventionTips":["Retry with backoff — the page may hydrate late","Confirm the Businessweek page lists stories in a browser","Handle the empty case gracefully in downstream code"],"tags":["scraping","empty-result","bloomberg"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}