jackwener/OpenCLI · warning · EmptyResultError

Reddit returned no subscribed subreddits for the logged-in a

Error message

Reddit returned no subscribed subreddits for the logged-in account.

What it means

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.

Source

Thrown at clis/reddit/subscribed.js:161

        }
        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

  1. Confirm in the browser that the account actually has subscribed subreddits (reddit.com/subreddits).
  2. Pass a larger --limit if you expected data beyond the current limit.
  3. Log in with the intended account — a fresh secondary account often has no subs.
  4. Catch EmptyResultError in scripts and treat it as 'no data' rather than an infrastructure problem.

Example fix

// before
const rows = await redditSubscribed({ limit: 15 }); // throws EmptyResultError
// after
let rows;
try { rows = await redditSubscribed({ limit: 15 }); }
catch (e) {
  if (e.name === 'EmptyResultError') rows = [];
  else throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

// account check before expecting data: confirm the account actually has subscriptions in the browser

Try / catch

try {
  const rows = await run(['reddit', 'subscribed']);
} catch (e) {
  if (e.name === 'EmptyResultError') {
    return []; // treat as 'no data', not a failure
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: Brand-new Reddit account with no subscriptions; account where all subs were unsubscribed; NSFW-filtered accounts where all subs are hidden; passing limit 0.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/39369b5827853a02. Report an issue: GitHub.