DIYgod/RSSHub · warning · InvalidParameterError

这个人没有任何动态。

Error message

这个人没有任何动态。

What it means

The coolapk user-dynamic route calls /v6/user/feedList and checks response.data.data. If data is falsy (null or undefined), the API did not return a feed list. This typically means the user account does not exist, has been deleted, or the API returned an error object where the data field is absent.

Source

Thrown at lib/routes/coolapk/user-dynamic.ts:40

        supportBT: false,
        supportPodcast: false,
        supportScihub: false,
    },
    name: '用户',
    maintainers: ['xizeyoupan'],
    handler,
};

async function handler(ctx) {
    const uid = ctx.req.param('uid');
    const full_url = utils.base_url + `/v6/user/feedList?uid=${uid}&page=1&showAnonymous=0&isIncludeTop=1&showDoing=1`;
    let username;
    const response = await got(full_url, {
        headers: utils.getHeaders(),
    });
    const data = response.data.data;
    if (!data) {
        throw new InvalidParameterError('这个人没有任何动态。');
    }
    let out = await Promise.all(
        data.map((item) => {
            if (!username) {
                username = item.username;
            }

            return utils.parseDynamic(item);
        })
    );

    out = out.filter(Boolean); // 去除空值
    if (out.length === 0) {
        throw new InvalidParameterError('这个人还没有图文或动态。');
    }
    return {
        title: `酷安个人动态-${username}`,
        link: `https://www.coolapk.com/u/${uid}`,

View on GitHub (pinned to bed535e087)

Solutions

  1. Verify the uid is valid by visiting https://www.coolapk.com/u/<uid> in a browser.
  2. Log response.data to inspect the full API response and check for an error field.
  3. Check if the coolapk API requires additional authentication or headers for user feeds.
  4. Consider adding a distinct error for 'user not found' vs 'user has no dynamics'.

Example fix

// before
const data = response.data.data;
if (!data) {
    throw new InvalidParameterError('这个人没有任何动态。');
}

// after — distinguish not-found from empty
const data = response.data.data;
if (!data) {
    if (response.data.errorCode || response.data.error) {
        throw new InvalidParameterError(`User ${uid} not found or inaccessible`);
    }
    throw new InvalidParameterError('这个人没有任何动态。');
}
Defensive patterns

Strategy: validation

Validate before calling

// Check the full API response structure
const data = response.data?.data;
if (!data) {
    if (response.data?.errorMessage) {
        throw new InvalidParameterError(`Coolapk API error: ${response.data.errorMessage}`);
    }
    throw new InvalidParameterError(`User ${uid} not found or has no dynamics`);
}

Type guard

function hasUserData(response: any): response is { data: { data: any[] } } {
    return response?.data?.data != null && Array.isArray(response.data.data);
}

Prevention

When it happens

Trigger: got() succeeds (HTTP 200) but response.data.data is null or undefined. The coolapk API wraps results in a top-level { data: { data: [...] } } structure — if the inner data is null, the user has no accessible feed.

Common situations: The uid does not correspond to a valid coolapk user; the user account was banned or deleted; coolapk's API returns an error response (e.g., { status: 0, error: -1 }) where .data.data is null; rate limiting causes the API to return a truncated response.

Related errors


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