{"record":{"id":"a77c6df63ac858f3","repo":"DIYgod/RSSHub","slug":"error-a77c6d","errorCode":null,"errorMessage":"ユーザー名は@で始まる必要があります","messagePattern":"ユーザー名は@で始まる必要があります","errorType":"validation","errorClass":"InvalidParameterError","httpStatus":503,"severity":"warning","filePath":"lib/routes/mixi2/user.ts","lineNumber":16,"sourceCode":"import type { Context } from 'hono';\n\nimport InvalidParameterError from '@/errors/types/invalid-parameter';\nimport type { Data, Route } from '@/types';\nimport { ViewType } from '@/types';\nimport { parseDate } from '@/utils/parse-date';\n\nimport { CONFIG_OPTIONS, getClient, parsePost, postFilter } from './utils';\n\nconst handler = async (ctx: Context) => {\n    const limit = Number(ctx.req.query('limit') ?? '20');\n    const name = ctx.req.param('name');\n    const mediaOnly = ctx.req.param('media') === 'media';\n\n    if (!name!.startsWith('@')) {\n        throw new InvalidParameterError('ユーザー名は@で始まる必要があります');\n    }\n\n    const client = getClient();\n\n    const userInfo = await client.getPersonaByName({\n        name: name!.slice(1),\n    });\n\n    const persona = userInfo.persona;\n\n    const data = await client.getPersonalTimeline({\n        personaId: persona?.personaId,\n        limit,\n        mediaOnly,\n    });\n\n    return {\n        title: `${persona?.name} - ${mediaOnly ? 'メディア' : 'ポスト'}`,","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/mixi2/user.ts#L1-L34","documentation":"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.","triggerScenarios":"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.","commonSituations":"User pastes the bare handle copied from a URL path; URL builder drops the @; user passes the full https://mixi.social/@name URL.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const name = ctx.req.param('name');\nif (!name || !name.startsWith('@')) {\n    throw new InvalidParameterError(`Username must start with '@', e.g. @deyo; got: ${name}`);\n}","typeGuard":"function isAtHandle(name: string): boolean {\n    return typeof name === 'string' && name.startsWith('@') && name.length > 1;\n}","tryCatchPattern":null,"preventionTips":["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."],"tags":["invalid-parameter","validation","handle-format","mixi2"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}