{"record":{"id":"e09fb02f4abe002b","repo":"fish2018/pansou","slug":"s-hsid-s-s","errorCode":null,"errorMessage":"[%s] hsid=%s不支持的网盘平台: %s","messagePattern":"\\[(.+?)\\] hsid=(.+?)不支持的网盘平台: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"plugin/haisou/haisou.go","lineNumber":432,"sourceCode":"\tif err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"[%s] hsid=%s读取响应失败: %w\", p.Name(), hsid, err)\n\t}\n\n\t// 解析响应\n\tvar apiResp FetchAPIResponse\n\tif err := json.Unmarshal(body, &apiResp); err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"[%s] hsid=%s链接JSON解析失败: %w\", p.Name(), hsid, err)\n\t}\n\n\t// 检查API响应状态\n\tif apiResp.Code != 0 {\n\t\treturn \"\", \"\", fmt.Errorf(\"[%s] hsid=%s链接API错误: %s\", p.Name(), hsid, apiResp.Msg)\n\t}\n\n\t// 根据平台类型构建完整的分享链接\n\tshareURL := buildShareURL(platform, apiResp.Data.ShareCode)\n\tif shareURL == \"\" {\n\t\treturn \"\", \"\", fmt.Errorf(\"[%s] hsid=%s不支持的网盘平台: %s\", p.Name(), hsid, platform)\n\t}\n\n\t// 获取密码\n\tpassword := \"\"\n\tif apiResp.Data.SharePwd != nil {\n\t\tpassword = *apiResp.Data.SharePwd\n\t}\n\n\tif DebugLog {\n\t\tfmt.Printf(\"[%s] hsid=%s成功获取链接: %s password=%s\\n\", p.Name(), hsid, shareURL, password)\n\t}\n\n\treturn shareURL, password, nil\n}\n\n// doRequestWithRetry 带重试机制的HTTP请求\nfunc (p *HaisouPlugin) doRequestWithRetry(req *http.Request, client *http.Client) (*http.Response, error) {\n\tmaxRetries := 3","sourceCodeStart":414,"sourceCodeEnd":450,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/haisou/haisou.go#L414-L450","documentation":"This error is thrown when the API returned a share code successfully but buildShareURL returned an empty string, meaning the plugin does not recognize the platform value returned/passed for this hsid. It indicates an unsupported or mistyped cloud-drive platform identifier (e.g. something other than ali/quark/uc/baidu etc. that buildShareURL handles).","triggerScenarios":"fetchShareLink calls buildShareURL(platform, apiResp.Data.ShareCode) and gets \"\" back because strings.ToLower(platform) matches no case in the switch.","commonSituations":"Upstream added a new cloud-drive platform the plugin doesn't support yet; platform string casing/spelling mismatch (e.g. 'Aliyun' vs 'ali'); platform data corrupted or empty in the API response; caller passed a platform name in a different language.","solutions":["Log the offending platform value and add a case for it in buildShareURL if the platform should be supported","Normalize/alias common platform spellings in buildShareURL (e.g. 'aliyun'→'ali', '夸克'→'quark')","Validate the platform value at the caller level before invoking fetchShareLink","Update the plugin if upstream introduced a new supported pan type"],"exampleFix":"// before\nswitch strings.ToLower(platform) {\ncase \"ali\":\n\t...\n}\n// after\nswitch p := strings.ToLower(strings.TrimSpace(platform)); p {\ncase \"ali\", \"aliyun\":\n\t...\ncase \"quark\":\n\t...\ndefault:\n\t// leave returning \"\" so callers report 不支持的网盘平台: %s with the raw value\n}","handlingStrategy":"validation","validationCode":"supported := map[string]bool{\"ali\": true, \"quark\": true, \"uc\": true, \"baidu\": true}\nif !supported[strings.ToLower(platform)] {\n\treturn fmt.Errorf(\"platform %q is not supported\", platform)\n}","typeGuard":"func isSupportedPlatform(p string) bool {\n\tswitch strings.ToLower(strings.TrimSpace(p)) {\n\tcase \"ali\", \"quark\", \"uc\", \"baidu\":\n\t\treturn true\n\t}\n\treturn false\n}","tryCatchPattern":"shareURL := buildShareURL(platform, apiResp.Data.ShareCode)\nif shareURL == \"\" {\n\tlog.Printf(\"skip hsid=%s: unsupported platform %q\", hsid, platform)\n\treturn \"\", \"\", fmt.Errorf(\"unsupported platform: %s\", platform)\n}","preventionTips":["Normalize platform names (trim, lowercase, alias common spellings) before mapping","Update buildShareURL when upstream adds new pan types","Skip unsupported platforms gracefully instead of failing the batch","Log unknown platform values to discover new upstream types early"],"tags":["unsupported","platform","mapping","go"],"backgroundTag":"unsupported-operation","analyzedSha":"beaa56133755a548ebc51b090b3816e2ae044aa6","analyzedAt":"2026-09-07T00:31:18.025Z","contentChangedAt":"2026-09-07T00:31:18.025Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}