{"record":{"id":"a7fe7d93bc1657f6","repo":"AlistGo/alist","slug":"errorcode-d-error-s-serverruntime-f-serve","errorCode":null,"errorMessage":"ErrorCode: %d ,Error: %s ,ServerRunTime: %f ,ServerName: %s","messagePattern":"ErrorCode: (.+?) ,Error: (.+?) ,ServerRunTime: (.+?) ,ServerName: (.+?)","errorType":"error_code","errorClass":"ErrResp","httpStatus":null,"severity":"error","filePath":"drivers/febbox/util.go","lineNumber":64,"sourceCode":"\t}\n\n\tswitch e.ErrorCode {\n\tcase 0:\n\t\treturn res.Body(), nil\n\tcase 1:\n\t\treturn res.Body(), nil\n\tcase -10001:\n\t\tif e.ServerName != \"\" {\n\t\t\t// access_token 过期\n\t\t\tif err = d.refreshTokenByOAuth2(); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn d.request(url, method, callback, resp)\n\t\t} else {\n\t\t\treturn nil, errors.New(e.Error())\n\t\t}\n\tdefault:\n\t\treturn nil, errors.New(e.Error())\n\t}\n}\n\nfunc (d *FebBox) getFilesList(id string) ([]File, error) {\n\tif d.PageSize <= 0 {\n\t\td.PageSize = 100\n\t}\n\tres, err := d.listWithLimit(id, d.PageSize)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn *res, nil\n}\n\nfunc (d *FebBox) listWithLimit(dirID string, pageLimit int64) (*[]File, error) {\n\tvar files []File\n\tpage := int64(1)\n\tfor {","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/febbox/util.go#L46-L82","documentation":"This is the default branch of the FebBox request handler: the API responded with an ErrorCode other than 0, 1, or -10001, so the driver wraps the server's own error payload (code, message, runtime, server name) into a Go error. It is the generic pass-through for every FebBox API failure that is not a success or a recoverable token expiry.","triggerScenarios":"Any FebBox API call whose response error body carries ErrorCode not in {0, 1, -10001} — e.g. insufficient permissions, invalid folder id, quota exceeded, rate limited, or file not found. Reached at drivers/febbox/util.go:63-64.","commonSituations":"Deleted or invalid folder ID used as root path; account quota or rate limits hit on the FebBox service; token revoked so all calls fail with a non--10001 code; FebBox API maintenance returning an unfamiliar error code.","solutions":["Read the numeric ErrorCode and Error text in the message — they come straight from FebBox and map to the service's own error table.","If the code indicates auth failure, re-authorize the storage (refresh the OAuth tokens) in the driver settings.","Verify the root folder ID and any configured paths are valid for the account in use.","If rate-limited, reduce concurrency/PageSize and retry after the interval indicated by ServerRunTime/ServerName context.","Search or report the specific code in the OpenList/AList issue tracker if it is undocumented."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"body, err := d.request(url, method, cb, resp)\nif err != nil {\n    var code int\n    if _, ok := fmt.Sscanf(err.Error(), \"ErrorCode: %d\", &code); ok {\n        // map known FebBox codes to user-facing messages / retry policy\n    }\n    return err\n}","preventionTips":["Map FebBox error codes to actionable messages in your wrapper.","Respect rate limits by throttling request concurrency.","Alert on unknown codes — they indicate API-side changes."],"tags":["febbox","api-error","go","pass-through"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}