{"record":{"id":"7716aee954179b28","repo":"AlistGo/alist","slug":"d-s","errorCode":null,"errorMessage":"%d: %s","messagePattern":"%d: %s","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/ilanzou/util.go","lineNumber":106,"sourceCode":"\tif err != nil {\n\t\tif res != nil {\n\t\t\tlog.Errorf(\"[iLanZou] request error: %s\", res.String())\n\t\t}\n\t\treturn nil, err\n\t}\n\tisRetry := len(retry) > 0 && retry[0]\n\tbody := res.Body()\n\tcode := utils.Json.Get(body, \"code\").ToInt()\n\tmsg := utils.Json.Get(body, \"msg\").ToString()\n\tif code != 200 {\n\t\tif !isRetry && proved && (utils.SliceContains([]int{-1, -2}, code) || d.Token == \"\") {\n\t\t\terr = d.login()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn d.request(pathname, method, callback, proved, true)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"%d: %s\", code, msg)\n\t}\n\treturn body, nil\n}\n\nfunc (d *ILanZou) unproved(pathname, method string, callback base.ReqCallback) ([]byte, error) {\n\treturn d.request(\"/\"+d.conf.unproved+pathname, method, callback, false)\n}\n\nfunc (d *ILanZou) proved(pathname, method string, callback base.ReqCallback) ([]byte, error) {\n\treturn d.request(\"/\"+d.conf.proved+pathname, method, callback, true)\n}\n","sourceCodeStart":88,"sourceCodeEnd":118,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/ilanzou/util.go#L88-L118","documentation":"The generic non-200-code error from ILanZou's request wrapper: the JSON body's code field is not 200 and none of the retry conditions applied (already retried, not a proved call, code not in {-1,-2}, or token already present). Format 'code: msg' exposes the provider's numeric code and message. Codes -1/-2 (auth expiry) on proved routes trigger exactly one automatic re-login and retry before this error surfaces.","triggerScenarios":"Parameter errors (invalid folder/file IDs), permission failures, rate-limit codes, or auth codes appearing on unproved routes (which never re-login); a re-login that succeeded but the retry still returned non-200.","commonSituations":"Acting on object IDs from a stale directory listing; hitting per-hour API quotas; the account lacking the required operation rights; token expired while a proved retry loop exhausted its single attempt.","solutions":["Look up the numeric code in the embedded msg path — it is the provider's own taxonomy and points at the fix.","Refresh the listing to get current IDs, then retry the operation.","For repeated -1/-2 after auto-relogin, force a fresh login (clear Token) and check credentials — re-login may be silently failing elsewhere.","Back off if the code indicates rate limiting; do not tight-loop retries."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"body, err := d.proved(path, method, cb)\nif err != nil {\n    if code := extractCode(err); code == -1 || code == -2 {\n        // wrapper already retried once; force relogin and try once more\n        _ = d.login()\n        body, err = d.proved(path, method, cb)\n    }\n    if err != nil { return classify(err) }\n}","preventionTips":["Re-list directories to refresh object IDs before mutations","Rate-limit request loops","Map numeric codes to typed errors in your caller for testable handling"],"tags":["ilanzou","api-code","retry","auth-expiry"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}