{"record":{"id":"39369b5827853a02","repo":"jackwener/OpenCLI","slug":"reddit-returned-no-subscribed-subreddits-for-the-l","errorCode":null,"errorMessage":"Reddit returned no subscribed subreddits for the logged-in account.","messagePattern":"Reddit returned no subscribed subreddits for the logged-in account\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/reddit/subscribed.js","lineNumber":161,"sourceCode":"        }\n        if (result?.kind === 'auth') {\n            throw new AuthRequiredError('reddit.com', result.detail);\n        }\n        if (result?.kind === 'http') {\n            throw new CommandExecutionError(`HTTP ${result.httpStatus} from ${result.where}`);\n        }\n        if (result?.kind === 'malformed') {\n            throw new CommandExecutionError(result.detail);\n        }\n        if (result?.kind === 'exception') {\n            throw new CommandExecutionError(`subscribed failed: ${result.detail}`);\n        }\n        if (result?.kind !== 'ok' || !Array.isArray(result.entries)) {\n            throw new CommandExecutionError(`Unexpected result from reddit subscribed: ${JSON.stringify(result)}`);\n        }\n        const rows = result.entries.slice(0, limit).map((entry, index) => mapSubredditRow(entry, index));\n        if (rows.length === 0) {\n            throw new EmptyResultError('Reddit returned no subscribed subreddits for the logged-in account.');\n        }\n        return rows;\n    }\n});\n","sourceCodeStart":143,"sourceCodeEnd":166,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/reddit/subscribed.js#L143-L166","documentation":"After a successful ('ok') result whose entries array maps to zero rows within the requested limit, subscribed.js throws EmptyResultError('Reddit returned no subscribed subreddits for the logged-in account.'). This distinguishes 'authenticated but genuinely no data' from failures. The library treats an empty result set as a distinct, non-fatal condition for scripting.","triggerScenarios":"Calling `reddit subscribed` with a valid logged-in Reddit account that has zero subreddit subscriptions (or fewer than `limit` — zero after slicing), and result.entries is an empty array.","commonSituations":"Brand-new Reddit account with no subscriptions; account where all subs were unsubscribed; NSFW-filtered accounts where all subs are hidden; passing limit 0.","solutions":["Confirm in the browser that the account actually has subscribed subreddits (reddit.com/subreddits).","Pass a larger --limit if you expected data beyond the current limit.","Log in with the intended account — a fresh secondary account often has no subs.","Catch EmptyResultError in scripts and treat it as 'no data' rather than an infrastructure problem."],"exampleFix":"// before\nconst rows = await redditSubscribed({ limit: 15 }); // throws EmptyResultError\n// after\nlet rows;\ntry { rows = await redditSubscribed({ limit: 15 }); }\ncatch (e) {\n  if (e.name === 'EmptyResultError') rows = [];\n  else throw e;\n}","handlingStrategy":"try-catch","validationCode":"// account check before expecting data: confirm the account actually has subscriptions in the browser","typeGuard":null,"tryCatchPattern":"try {\n  const rows = await run(['reddit', 'subscribed']);\n} catch (e) {\n  if (e.name === 'EmptyResultError') {\n    return []; // treat as 'no data', not a failure\n  }\n  throw e;\n}","preventionTips":["Check the account actually has subscriptions before expecting output","Use the intended logged-in account (new accounts have no subs)","Pass an appropriate --limit value","Treat EmptyResultError as a normal empty-data signal in scripts"],"tags":["empty-result","reddit","no-data"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}