{"record":{"id":"466fea3a593c9df3","repo":"fish2018/pansou","slug":"quarkres-api-error-s","errorCode":null,"errorMessage":"[quarkres] API error: %s","messagePattern":"\\[quarkres\\] API error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/quarkres/quarkres.go","lineNumber":114,"sourceCode":"\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != 200 {\n\t\treturn nil, fmt.Errorf(\"[quarkres] HTTP %d\", resp.StatusCode)\n\t}\n\n\tbodyBytes, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"[quarkres] read response failed: %w\", err)\n\t}\n\n\tvar ar apiResp\n\tif err := json.Unmarshal(bodyBytes, &ar); err != nil {\n\t\treturn nil, fmt.Errorf(\"[quarkres] decode response failed: %w\", err)\n\t}\n\n\tif ar.Code != 200 {\n\t\treturn nil, fmt.Errorf(\"[quarkres] API error: %s\", ar.Message)\n\t}\n\n\tresults := make([]model.SearchResult, 0, len(ar.Data))\n\tfor _, item := range ar.Data {\n\t\tlinks := make([]model.Link, 0, len(item.Links))\n\t\tfor _, l := range item.Links {\n\t\t\t// 只保留夸克链接（本源只有夸克）\n\t\t\tif strings.Contains(l.URL, \"pan.quark.cn\") {\n\t\t\t\tlinks = append(links, model.Link{\n\t\t\t\t\tType:     \"quark\",\n\t\t\t\t\tURL:      l.URL,\n\t\t\t\t\tPassword: l.Password,\n\t\t\t\t\tDatetime: item.Datetime,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif len(links) == 0 {\n\t\t\tcontinue","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/quarkres/quarkres.go#L96-L132","documentation":"API-level error in quarkres' doSearch (plugin/quarkres/quarkres.go:114): the JSON decoded but the API's Code field is not 200; its Message text is embedded in the error. A well-formed response reporting a query failure.","triggerScenarios":"Thrown at plugin/quarkres/quarkres.go:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["按 Message 区分处理：修正输入或降频","监控该错误发现 API 协议变更"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}