DIYgod/RSSHub · warning · InvalidParameterError
ユーザー名は@で始まる必要があります
Error message
ユーザー名は@で始まる必要があります
What it means
Thrown as InvalidParameterError by the mixi2 (mixi social) user route when the :name path parameter does not start with '@'. The route expects the leading-@ handle form (e.g. @deyo) because the underlying MixiClient.getPersonaByName takes the name without the @, which the handler strips via name.slice(1). A name without '@' would corrupt that strip, so it is rejected up front.
Source
Thrown at lib/routes/mixi2/user.ts:16
import type { Context } from 'hono';
import InvalidParameterError from '@/errors/types/invalid-parameter';
import type { Data, Route } from '@/types';
import { ViewType } from '@/types';
import { parseDate } from '@/utils/parse-date';
import { CONFIG_OPTIONS, getClient, parsePost, postFilter } from './utils';
const handler = async (ctx: Context) => {
const limit = Number(ctx.req.query('limit') ?? '20');
const name = ctx.req.param('name');
const mediaOnly = ctx.req.param('media') === 'media';
if (!name!.startsWith('@')) {
throw new InvalidParameterError('ユーザー名は@で始まる必要があります');
}
const client = getClient();
const userInfo = await client.getPersonaByName({
name: name!.slice(1),
});
const persona = userInfo.persona;
const data = await client.getPersonalTimeline({
personaId: persona?.personaId,
limit,
mediaOnly,
});
return {
title: `${persona?.name} - ${mediaOnly ? 'メディア' : 'ポスト'}`,View on GitHub (pinned to bed535e087)
Solutions
- Prefix the username with '@', e.g. /mixi2/user/@deyo (optionally followed by /media for media-only).
- Strip any leading URL scheme/path before the @ in any feed-URL generator.
- If maintaining the route, consider auto-prepending '@' when missing instead of throwing.
Defensive patterns
Strategy: validation
Validate before calling
const name = ctx.req.param('name');
if (!name || !name.startsWith('@')) {
throw new InvalidParameterError(`Username must start with '@', e.g. @deyo; got: ${name}`);
} Type guard
function isAtHandle(name: string): boolean {
return typeof name === 'string' && name.startsWith('@') && name.length > 1;
} Prevention
- Always pass the leading '@' when constructing the feed URL.
- Document the required '@'-prefixed form in the route parameters.
- Consider normalising by auto-prepending '@' if the route wants to be lenient.
When it happens
Trigger: Caller requests /mixi2/user/<name> where name is e.g. 'deyo' (no @), an empty string, or a URL. The startsWith('@') check fails and it throws before constructing the client.
Common situations: User pastes the bare handle copied from a URL path; URL builder drops the @; user passes the full https://mixi.social/@name URL.
Related errors
- Invalid category
- At least one valid search parameter is required
- 无法检测 Discuz 版本,请在路由中指定版本参数,如 /discuz/x/ 或 /discuz/7/
- 通知类型${typeParam}未定义
- Unsupported language: ${language}
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/a77c6df63ac858f3.
Report an issue: GitHub.