{"record":{"id":"18682c0b0396e24e","repo":"AlistGo/alist","slug":"error-v","errorCode":null,"errorMessage":"error:%v","messagePattern":"error:(.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/chaoxing/driver.go","lineNumber":301,"sourceCode":"\tif err != nil {\n\t\treturn err\n\t}\n\tquery := map[string]string{\n\t\t\"bbsid\":  d.Addition.Bbsid,\n\t\t\"pid\":    dstDir.GetID(),\n\t\t\"type\":   \"yunpan\",\n\t\t\"params\": url.QueryEscape(\"[\" + string(params) + \"]\"),\n\t}\n\tvar respd ListFileResp\n\t_, err = d.request(\"/pc/resource/addResource\", http.MethodGet, func(req *resty.Request) {\n\t\treq.SetQueryParams(query)\n\t}, &respd)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif respd.Result != 1 {\n\t\tmsg := fmt.Sprintf(\"error:%v\", resp.Msg)\n\t\treturn errors.New(msg)\n\t}\n\treturn nil\n}\n\nvar _ driver.Driver = (*ChaoXing)(nil)\n","sourceCodeStart":283,"sourceCodeEnd":307,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/chaoxing/driver.go#L283-L307","documentation":"Returned by ChaoXing Put when /pc/resource/addResource (registering the uploaded file in the drive) answers with respd.Result != 1. Note a source bug: the message formats resp.Msg (the earlier UploadDataRsp whose Msg is a struct), not respd.Msg, so the reported text is unhelpful like 'error:{%!v(PANIC=...) }' or a struct dump.","triggerScenarios":"Finalizing an upload where addResource rejects the params — invalid bbsid, wrong pid, malformed params JSON, or expired session — while the driver's error text reads from the wrong variable (resp instead of respd at drivers/chaoxing/driver.go:300).","commonSituations":"Uploads that succeed byte-wise but never appear in the listing; any addResource business failure surfaces a garbled message, masking the real server reason.","solutions":["Fix the variable locally or patch upstream: use respd.Msg instead of resp.Msg in the error format string, then rebuild","Re-list the destination to confirm the file truly did not register; retry the upload","Verify bbsid and destination pid are valid before uploading","Update alist once the upstream fix lands; check issue tracker for chaoxing upload fixes"],"exampleFix":"// before (drivers/chaoxing/driver.go:300)\nmsg := fmt.Sprintf(\"error:%v\", resp.Msg)\n// after\nmsg := fmt.Sprintf(\"error:%v\", respd.Msg)","handlingStrategy":"try-catch","validationCode":"null","typeGuard":null,"tryCatchPattern":"if err := d.Put(ctx, dst, f, up); err != nil && strings.Contains(err.Error(), \"error:\") {\n    // message is garbled due to driver bug (resp vs respd); re-list dst to verify,\n    // retry once, and patch driver to use respd.Msg for real diagnostics\n}","preventionTips":["Patch/track the upstream bug: format respd.Msg, not resp.Msg","Verify upload outcome by listing, since the error text is unreliable","Retry the complete upload when addResource fails"],"tags":["chaoxing","upload","bug","api-error"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}