jackwener/OpenCLI · warning · EmptyResultError

${result.detail}

Error message

${result.detail}

What it means

The page script classifies fetch outcomes into envelope kinds; kind 'inaccessible' means the post could not be accessed (e.g. removed, deleted, private subreddit, quarantined, or banned). The detail string is surfaced as an EmptyResultError, telling the caller the fetch succeeded mechanically but there is no readable content.

Source

Thrown at clis/reddit/read.js:566

          });
        }

        // If we produced nothing beyond the POST row but the comment listing
        // wasn't empty, that's parser drift (e.g. Reddit changed t1/more
        // schema). Surface as CommandExecutionError on the Node side.
        if (rows.length <= 1 && preWalkSize > 0 && t1TopLevel.length > 0) {
          return { kind: 'parser-drift', detail: 'Reddit comment listing for post ' + postId + ' had ' + t1TopLevel.length + ' t1 entries but walker produced no rows.' };
        }

        return { kind: 'ok', rows: rows, expandMeta: expandMeta };
      })()
    `);

        if (!result || typeof result !== 'object') {
            throw new CommandExecutionError('Reddit /comments fetch returned no result envelope.');
        }
        if (result.kind === 'inaccessible') {
            throw new EmptyResultError(result.detail);
        }
        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 === 'parser-drift') {
            throw new CommandExecutionError(result.detail);
        }
        if (result.kind === 'expand-failed') {
            throw new CommandExecutionError(result.detail);
        }
        if (result.kind !== 'ok' || !Array.isArray(result.rows)) {
            throw new CommandExecutionError(`Unexpected result from reddit read: ${JSON.stringify(result)}`);

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Verify the post still exists by opening the URL in a logged-in browser.
  2. Ensure session cookies grant access (join/login to the subreddit if private or age-gated).
  3. Treat as expected-empty in automation: catch EmptyResultError and skip the post id.
Defensive patterns

Strategy: try-catch

Type guard

null

Try / catch

try {
  const rows = await redditRead(postId);
} catch (e) {
  if (e instanceof EmptyResultError) {
    console.warn(`Post ${postId} inaccessible: ${e.message}; skipping`);
    return [];
  }
  throw e;
}

Prevention

When it happens

Trigger: Fetching a deleted/removed post, a post in a private or banned subreddit, or a post requiring login/age verification that the current session cannot view.

Common situations: Post was deleted after you saved its id; subreddit went private; [removed] by moderators; region or age-gated content with insufficient cookies.

Related errors


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