{"record":{"id":"0a7688b6988e1860","repo":"DIYgod/RSSHub","slug":"this-user-may-not-have-any-novel-works-or-is-an-r","errorCode":null,"errorMessage":"This user may not have any novel works, or is an R18 creator, PIXIV_REFRESHTOKEN is required.\npixiv RSS is disabled due to the lack of relevant config.\n該用戶可能沒有小說作品，或者該用戶爲 R18 創作者，需要 PIXIV_REFRESHTOKEN。","messagePattern":"This user may not have any novel works, or is an R18 creator, PIXIV_REFRESHTOKEN is required\\.\npixiv RSS is disabled due to the lack of relevant config\\.\n該用戶可能沒有小說作品，或者該用戶爲 R18 創作者，需要 PIXIV_REFRESHTOKEN。","errorType":"error_code","errorClass":"ConfigNotFoundError","httpStatus":503,"severity":"error","filePath":"lib/routes/pixiv/novels.ts","lineNumber":99,"sourceCode":"    if (hasPixivAuth()) {\n        return await getNSFWUserNovels(id, fullContent, limit);\n    }\n\n    let nonR18Result;\n    try {\n        nonR18Result = await getSFWUserNovels(id, fullContent, limit);\n    } catch (error: any) {\n        if (error.name !== 'Error') {\n            throw error;\n        }\n        nonR18Result = null;\n    }\n\n    if (nonR18Result) {\n        return nonR18Result;\n    }\n\n    throw new ConfigNotFoundError(\n        'This user may not have any novel works, or is an R18 creator, PIXIV_REFRESHTOKEN is required.\\npixiv RSS is disabled due to the lack of relevant config.\\n該用戶可能沒有小說作品，或者該用戶爲 R18 創作者，需要 PIXIV_REFRESHTOKEN。'\n    );\n}\n","sourceCodeStart":81,"sourceCodeEnd":103,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/pixiv/novels.ts#L81-L103","documentation":"ConfigNotFoundError thrown at the end of the /pixiv/user/novels/:id handler when there is no pixiv auth AND the SFW path failed with a generic Error. The handler first tries getNSFWUserNovels if auth exists, else tries getSFWUserNovels; if SFW throws a plain Error it is swallowed (nonR18Result=null), and this final throw reports the ambiguity: the user may have no novels, or may be R18-only and need a token.","triggerScenarios":"No PIXIV_REFRESHTOKEN configured, and the SFW user-novels fetch returned zero novels (either truly none, or all R18-gated). This is the terminal error after both branches are exhausted.","commonSituations":"Requesting an R18-only author without credentials; requesting a user with no novels at all; credentials removed since last successful fetch.","solutions":["Configure PIXIV_REFRESHTOKEN so the NSFW branch handles R18 authors (the handler prefers it when present).","Verify the user actually has novels on pixiv (SFW-visible).","Confirm the user ID is correct.","If the author is known SFW but empty, the feed is legitimately empty and the token will not help."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { config } from '@/config';\nconst hasPixivAuth = () => Boolean(config.pixiv && config.pixiv.refreshToken);\n// in the handler, prefer NSFW when auth exists to avoid reaching this terminal throw:\nif (hasPixivAuth()) {\n  return await getNSFWUserNovels(id, fullContent, limit);\n}","typeGuard":"const isConfigNotFound = (e: unknown): e is Error =>\n  e instanceof Error && (e as any).name === 'ConfigNotFoundError';","tryCatchPattern":"try {\n  // ...SFW attempt already wrapped internally...\n} catch (e) {\n  if (e instanceof ConfigNotFoundError && /PIXIV_REFRESHTOKEN/.test(e.message)) {\n    // terminal: either no novels or R18-only author; advise token configuration\n  }\n}","preventionTips":["Always try the NSFW path first when auth is configured so R18 authors resolve.","Tell end users that this error can mean either empty or R18-only.","Validate the user ID is numeric to avoid masking a typo with this ambiguous message."],"tags":["pixiv","config","nsfw","novel","fallback"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}