{"record":{"id":"4371b3a5fd1a9843","repo":"AlistGo/alist","slug":"error-code-is-d","errorCode":null,"errorMessage":"error code is:%d","messagePattern":"error code is:(.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/chaoxing/util.go","lineNumber":83,"sourceCode":"}\n\nfunc (d *ChaoXing) GetFiles(parent string) ([]File, error) {\n\tfiles := make([]File, 0)\n\tquery := map[string]string{\n\t\t\"bbsid\":    d.Addition.Bbsid,\n\t\t\"folderId\": parent,\n\t\t\"recType\":  \"1\",\n\t}\n\tvar resp ListFileResp\n\t_, err := d.request(\"/pc/resource/getResourceList\", http.MethodGet, func(req *resty.Request) {\n\t\treq.SetQueryParams(query)\n\t}, &resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif resp.Result != 1 {\n\t\tmsg := fmt.Sprintf(\"error code is:%d\", resp.Result)\n\t\treturn nil, errors.New(msg)\n\t}\n\tif len(resp.List) > 0 {\n\t\tfiles = append(files, resp.List...)\n\t}\n\tquerys := map[string]string{\n\t\t\"bbsid\":    d.Addition.Bbsid,\n\t\t\"folderId\": parent,\n\t\t\"recType\":  \"2\",\n\t}\n\tvar resps ListFileResp\n\t_, err = d.request(\"/pc/resource/getResourceList\", http.MethodGet, func(req *resty.Request) {\n\t\treq.SetQueryParams(querys)\n\t}, &resps)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, file := range resps.List {\n\t\t// 手机端超星上传的文件没有fileID字段，但ObjectID与fileID相同，可代替","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/chaoxing/util.go#L65-L101","documentation":"Returned by ChaoXing listFiles when /pc/resource/getResourceList answers with resp.Result != 1. The listing request (recType 1 for folders, 2 for files) was decoded but refused; only the numeric Result code is reported, not a message.","triggerScenarios":"Listing with an invalid bbsid, a folderId that does not exist under that bbsid, or an expired session — Result is any value other than 1.","commonSituations":"Wrong bbsid pasted in the storage addition; course/drive deleted so every list call fails; cookies expired so business endpoints return Result != 1 instead of a transport error.","solutions":["Confirm the bbsid by browsing the web client and copying the drive id from the URL","Refresh storage login credentials and re-list","If the root lists but a subfolder fails, the folder ID is stale — navigate from root again","Report/patch the driver to include resp.Msg for actionable messages"],"exampleFix":"// before\nmsg := fmt.Sprintf(\"error code is:%d\", resp.Result)\n// after\nmsg := fmt.Sprintf(\"error code is:%d, msg: %s\", resp.Result, resp.Msg)","handlingStrategy":"validation","validationCode":"func validBbsid(id string) bool { return strings.TrimSpace(id) != \"\" }\nif !validBbsid(d.Addition.Bbsid) { return errors.New(\"bbsid required\") }","typeGuard":null,"tryCatchPattern":"files, err := d.listFiles(parent)\nif err != nil && strings.Contains(err.Error(), \"error code is:\") {\n    // numeric only; re-login storage and retry once from root\n}","preventionTips":["Validate bbsid at storage creation","Navigate from root to refresh folder IDs after changes","Re-authenticate when Result codes persist"],"tags":["chaoxing","list","api-error"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}