{"record":{"id":"f2600e3e8d94b3e2","repo":"DIYgod/RSSHub","slug":"message","errorCode":null,"errorMessage":"[本地]信息有误，请检查后重试：${message}","messagePattern":"\\[本地\\]信息有误，请检查后重试：(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"lib/routes/kuaidi100/index.ts","lineNumber":57,"sourceCode":"    // First, check if code is vaild\n    const { status, message, company } = await utils.checkCode(number, id, phone);\n\n    let data;\n    const time = new Date().toString();\n\n    if (status) {\n        const query: any = await utils.getQuery(number, id, phone);\n        data =\n            query.status === '200'\n                ? query.data\n                : [\n                      {\n                          context: query.message,\n                          time,\n                      },\n                  ];\n    } else {\n        throw new Error(`[本地]信息有误，请检查后重试：${message}`);\n    }\n\n    // Maybe we can look into isCheck, condition, and state :)\n    // But I just want to make it work for now.\n    return {\n        title: `快递 ${company.name}-${id}`,\n        link: 'https://www.kuaidi100.com',\n        description: `快递 ${company.name}-${id}`,\n        item: data.map((item) => ({\n            title: item.context,\n            description: item.context,\n            guid: new Date(item.time || item.ftime).toUTCString(),\n            pubDate: new Date(item.time || item.ftime).toUTCString(),\n            link: 'https://www.kuaidi100.com',\n        })),\n    };\n}\n","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/kuaidi100/index.ts#L39-L75","documentation":"Thrown by the kuaidi100 (快递100) handler as a plain Error when utils.checkCode returns status=false — i.e. the company shorthand was not found in the company list, OR (for shunfeng) the last-4-phone was missing/invalid. The message embeds checkCode's `message` field, so the actual reason (unsupported company vs missing phone) is preserved.","triggerScenarios":"Request to /kuaidi100/track/<number>/<id>[/phone] where <number> is not a recognized company code in the kuaidi100 company.do list (status=false, message='快递公司编号不受支持！'), or where number contains 'shunfeng' but phone is absent/not 4 digits (message='顺丰查询需要手机号后四位！').","commonSituations":"Typo in company code (e.g. 'shunfengg'); using a company not registered with 快递100; forgetting the phone segment for SF Express; passing phone as a non-numeric string.","solutions":["Use a valid company `number` — look it up via utils.company() or the 快递100 company list","For SF Express (shunfeng), append the 4-digit phone suffix as the third path segment","Double-check spelling: e.g. shunfeng, zhongtong, yuantong, etc.","If the company genuinely exists but is missing from the cached list, bust the kuaidi100-company-name-<date> cache key"],"exampleFix":"// before\nthrow new Error(`[本地]信息有误，请检查后重试：${message}`);\n// after — distinguish the two sub-cases for the caller\nif (message.includes('手机号')) {\n    throw new InvalidParameterError(message); // user-fixable input\n} else {\n    throw new InvalidParameterError(`Unsupported company code '${number}'. ${message}`);\n}","handlingStrategy":"validation","validationCode":"import utils from './utils';\nasync function preflightKuaidi100(number: string, id: string, phone?: string) {\n  const { status, message } = await utils.checkCode(number, id, phone);\n  if (!status) throw new Error(`[preflight] ${message}`);\n}\n// call before utils.getQuery\nawait preflightKuaidi100(number, id, phone);","typeGuard":"interface CheckCodeOk { status: true; regex?: boolean; company: { name: string } }\ninterface CheckCodeFail { status: false; message: string; company: { name: string } }\nfunction checkCodeOk(r: CheckCodeOk | CheckCodeFail): r is CheckCodeOk { return r.status; }","tryCatchPattern":"try { await utils.getQuery(number, id, phone); }\ncatch (e) {\n  if (e instanceof Error && e.message.startsWith('[本地]')) {\n    // user-fixable input — surface as 400, do not retry\n    throw new InvalidParameterError(e.message);\n  }\n  throw e;\n}","preventionTips":["Always run checkCode before getQuery — it catches unsupported companies and missing SF phone","For shunfeng, require the 4-digit phone suffix at the route-validation layer","Cache the company list daily so checkCode stays fast","Document the company-code shorthand lookup for users"],"tags":["validation","parameter","catalog"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}