jackwener/OpenCLI · error · CliError

NOT_FOUND

NOT_FOUND

Error message

NOT_FOUND

What it means

GET /v1/podcast/get returned no `data` payload, so the CLI throws CliError NOT_FOUND with hint 'Please check the ID'. The library treats a missing podcast object as 'this podcast ID does not resolve' and surfaces it as a not-found error rather than an empty table.

Source

Thrown at clis/xiaoyuzhou/podcast.js:23

cli({
    site: 'xiaoyuzhou',
    name: 'podcast',
    access: 'read',
    description: 'View a Xiaoyuzhou podcast profile',
    domain: 'www.xiaoyuzhoufm.com',
    strategy: Strategy.LOCAL,
    browser: false,
    args: [{ name: 'id', positional: true, required: true, help: 'Podcast ID (from xiaoyuzhoufm.com URL)' }],
    columns: ['title', 'author', 'description', 'subscribers', 'episodes', 'updated'],
    func: async (args) => {
        const credentials = loadXiaoyuzhouCredentials();
        const response = await requestXiaoyuzhouJson('/v1/podcast/get', {
            query: { pid: args.id },
            credentials,
        });
        const p = response.data;
        if (!p)
            throw new CliError('NOT_FOUND', 'Podcast not found', 'Please check the ID');
        return [{
                title: p.title,
                author: p.author,
                description: p.brief,
                subscribers: p.subscriptionCount,
                episodes: p.episodeCount,
                updated: formatDate(p.latestEpisodePubDate),
            }];
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Double-check the podcast ID (pid) is complete and correct
  2. Confirm you are using a podcast pid, not an episode eid
  3. Re-fetch the pid from the xiaoyuzhou page/URL
  4. If the podcast was removed or made private, it cannot be fetched

Example fix

// before
opencli xiaoyuzhou podcast 69dd0c98e2c8be3  # truncated pid
// after
opencli xiaoyuzhou podcast 69dd0c98e2c8be31551f6a33
Defensive patterns

Strategy: validation

Validate before calling

const PID_RE = /^[0-9a-f]{24}$/i; // example shape
if (!PID_RE.test(pid)) throw new Error('pid looks malformed');

Type guard

const isNonEmptyPayload = (r) => r != null && r.data != null && typeof r.data === 'object';

Try / catch

try { const p = await getPodcast(pid); } catch (e) { if (String(e).includes('NOT_FOUND')) { console.error(`Podcast ${pid} not found; verify pid`); return null; } throw e; }

Prevention

When it happens

Trigger: Calling `opencli xiaoyuzhou podcast <pid>` with a pid that does not exist, was deleted, is private, or is malformed (truncated copy-paste, wrong entity's ID such as an eid used where a pid is expected).

Common situations: Swapping episode eid with podcast pid, IDs copied from URLs with extra query params, podcasts taken offline since being bookmarked, or regional/permission restrictions hiding the podcast.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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