{"record":{"id":"e77ad88ec3fbfb70","repo":"DIYgod/RSSHub","slug":"query-status-query-message","errorCode":null,"errorMessage":"[${query.status}]信息有误，请重新检查后订阅：${query.message}","messagePattern":"\\[(.+?)\\]信息有误，请重新检查后订阅：(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/routes/kuaidi100/utils.ts","lineNumber":265,"sourceCode":"            });\n\n            query = queryResponse.data;\n            if (query.status === '200') {\n                if (query.data && query.data[0].context === '查无结果') {\n                    // 查无结果 appears when cookie is invaild, force update cookie.\n                    clearCookie();\n                    throw new Error('暂时无法获取快递信息，请稍后重试...');\n                }\n                if (query.ischeck === '0') {\n                    // Not yet complete, don't cache for now.\n                    // To avoid frquent link test when add source, add 180s cache\n                    cache.set(query_key, query ?? '', 180);\n                } else {\n                    cache.set(query_key, query ?? ''); // Finished, cache id\n                }\n            } else {\n                cache.set(query_key, query ?? ''); // Error, cache as well\n                throw new Error(`[${query.status}]信息有误，请重新检查后订阅：${query.message}`);\n            }\n        }\n\n        return query;\n    },\n};\n","sourceCodeStart":247,"sourceCodeEnd":272,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/kuaidi100/utils.ts#L247-L272","documentation":"Thrown by kuaidi100's getQuery when the query API returns a `status` field that is not '200' (e.g. '408' = validation code error). Unlike the 查无结果 case, this is an explicit business error: the response carries a `message` (e.g. '快递公司参数异常：验证码错误') which is embedded into the thrown Error. The result is cached before throwing to avoid hammering the API with the same bad combo.","triggerScenarios":"GET /query returns status '408' (or any non-200 code) with a message describing the failure. Most often: wrong company-number pairing, malformed tracking id, or 快递100's anti-automation captcha requirement ('验证码错误').","commonSituations":"Mismatched company code and tracking number (e.g. zhongtong number passed as yuantong); tracking id with invalid format failing company.checkReg; captcha/verification-code challenge triggered by automation; upstream API envelope change.","solutions":["Verify the company `number` matches the carrier that actually issued the tracking id","Confirm the tracking id passes company.checkReg (see checkCode) before subscribing","If status is '408' with 验证码错误, slow down — you are hitting anti-automation; reduce query frequency","Cache is populated on error, so wait for the cache window to expire or bust kuaidi100-query-<number>-<id> before retrying"],"exampleFix":"// before\nthrow new Error(`[${query.status}]信息有误，请重新检查后订阅：${query.message}`);\n// after — classify captcha vs input error\nconst msg = `[${query.status}] ${query.message}`;\nif (query.status === '408') {\n    throw new Error(`${msg} (likely anti-automation captcha — reduce frequency)`);\n}\nthrow new Error(`信息有误，请重新检查后订阅：${msg}`);\n","handlingStrategy":"try-catch","validationCode":"// Inspect the envelope before subscribing\nasync function probeQuery(number: string, id: string, phone?: string): Promise<{ ok: boolean; status?: string; message?: string }> {\n  try {\n    const q = await utils.getQuery(number, id, phone);\n    return { ok: q.status === '200', status: q.status, message: q.message };\n  } catch (e) {\n    return { ok: false, message: (e as Error).message };\n  }\n}","typeGuard":"interface KuaidiQuery { status: string; message?: string; ischeck?: string; data?: { context?: string; time?: string }[] }\nfunction isQuerySuccess(q: KuaidiQuery): boolean { return q.status === '200'; }","tryCatchPattern":"try { await utils.getQuery(number, id, phone); }\ncatch (e) {\n  const msg = (e as Error).message;\n  if (/\\[408\\]|验证码/.test(msg)) {\n    // anti-automation — back off significantly, do not retry immediately\n    await new Promise((r) => setTimeout(r, 60_000));\n  } else if (/信息有误/.test(msg)) {\n    throw new InvalidParameterError(msg); // user-fixable input\n  }\n  throw e;\n}","preventionTips":["Verify company+tracking-id pairing via checkCode before subscribing","Back off hard on status 408 / 验证码错误 (anti-automation)","Cache error results (the route already does) to avoid repeated bad combos","Surface the exact status code to classify retryable vs permanent"],"tags":["api-response","validation","auth","anti-crawler"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}