{"record":{"id":"f9307372f8f5c8f7","repo":"fish2018/pansou","slug":"s-api-s-f93073","errorCode":null,"errorMessage":"[%s] API错误: %s","messagePattern":"\\[(.+?)\\] API错误: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/miaoso/miaoso.go","lineNumber":135,"sourceCode":"\tif resp.StatusCode != 200 {\n\t\treturn nil, fmt.Errorf(\"[%s] 请求返回状态码: %d\", p.Name(), resp.StatusCode)\n\t}\n\t\n\t// 读取响应体\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"[%s] 读取响应失败: %w\", p.Name(), err)\n\t}\n\t\n\t// 解析响应\n\tvar apiResp MiaosouResponse\n\tif err := json.Unmarshal(body, &apiResp); err != nil {\n\t\treturn nil, fmt.Errorf(\"[%s] JSON解析失败: %w\", p.Name(), err)\n\t}\n\t\n\t// 检查API响应状态\n\tif apiResp.Code != 200 {\n\t\treturn nil, fmt.Errorf(\"[%s] API错误: %s\", p.Name(), apiResp.Msg)\n\t}\n\t\n\t// 转换为标准格式\n\tresults := make([]model.SearchResult, 0, len(apiResp.Data.List))\n\tfor _, item := range apiResp.Data.List {\n\t\tresult, err := p.convertToSearchResult(item)\n\t\tif err != nil {\n\t\t\tcontinue // 跳过转换失败的项目\n\t\t}\n\t\t\n\t\t// 只添加有链接的结果\n\t\tif len(result.Links) > 0 {\n\t\t\tresults = append(results, result)\n\t\t}\n\t}\n\t\n\t// 关键词过滤\n\treturn results, nil","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/miaoso/miaoso.go#L117-L153","documentation":"Generic guard in searchImpl rejecting a search response whose JSON body parsed successfully but carried a non-200 business-level Code. The transport layer succeeded (HTTP status was 200 and JSON unmarshalled); the fault is upstream: the miaoso API itself reported an error via its Msg field, e.g. rate limiting, invalid parameters, or server-side failure.","triggerScenarios":"Thrown at plugin/miaoso/miaoso.go:135 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["按 Msg 内容区分处理：参数错误修正输入，配额限制降频","监控该错误以发现 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"}