DIYgod/RSSHub · warning · Error

没有获取到数据

Error message

没有获取到数据

What it means

Thrown by IssueHunt's funded route when the IssueHunt API response for a repo does not contain an `issues` field (`response.data.issues === undefined`). Plain `Error('没有获取到数据')` ('No data retrieved'). Indicates the upstream API did not return bounty data for the requested `username/repo`.

Source

Thrown at lib/routes/issuehunt/funded.ts:30

        requireConfig: false,
        requirePuppeteer: false,
        antiCrawler: false,
        supportBT: false,
        supportPodcast: false,
        supportScihub: false,
    },
    name: 'Project Funded',
    maintainers: ['running-grass'],
    handler,
};

async function handler(ctx) {
    const { username, repo } = ctx.req.param();
    const response = await got(`https://issuehunt.io/apis/pages/repos/show?repositoryOwnerName=${username}&repositoryName=${repo}`);

    const { issues } = response.data;
    if (issues === undefined) {
        throw new Error('没有获取到数据');
    }

    const md = MarkdownIt({
        html: true,
    });
    return {
        title: `Issue Hunt 的悬赏 -- ${username}/${repo}`,
        link: `https://issuehunt.io/r/${username}/${repo}`,
        description: '',
        item: issues.map((item) => ({
            title: item.title,
            description: md.render(item.body),
            pubDate: item.fundedAt,
            link: `https://issuehunt.io/r/${username}/${repo}/issues/${item.number}`,
            author: item.userName,
        })),
    };
}

View on GitHub (pinned to bed535e087)

Solutions

  1. Verify the repo exists on IssueHunt by visiting `https://issuehunt.io/r/<username>/<repo>`.
  2. Check the username/repo spelling against the GitHub canonical path.
  3. If the API shape changed, inspect `response.data` and update the handler to read the new field.
  4. Handle the empty case gracefully (return an empty feed) instead of throwing if that is the desired behavior.

Example fix

// before
const { issues } = response.data;
if (issues === undefined) {
    throw new Error('没有获取到数据');
}
// after (graceful empty feed)
const issues = response.data?.issues ?? [];
// ... proceed; an empty issues array yields an empty feed
Defensive patterns

Strategy: validation

Validate before calling

const r = await got(url);
if (!r.data || !Array.isArray(r.data.issues)) {
  throw new Error(`IssueHunt returned no issues for ${username}/${repo}`);
}

Type guard

const hasIssues = (d: any): d is {issues: any[]} =>
    d && Array.isArray(d.issues);

Prevention

When it happens

Trigger: Request to `/issuehunt/funded/:username/:repo` where IssueHunt's endpoint `https://issuehunt.io/apis/pages/repos/show?repositoryOwnerName=...&repositoryName=...` returns a payload without `.issues` — repo not tracked, renamed, deleted, or the API changed shape.

Common situations: Repo does not exist on IssueHunt (it was never enrolled for bounties); repo was renamed/transferred; IssueHunt changed/removed the API; rate-limited or empty response; typo in username/repo.

Related errors


AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12). Data as JSON: /api/errors/c4ccb9872d46d894. Report an issue: GitHub.