{"record":{"id":"1e792caed6b9cf09","repo":"fish2018/pansou","slug":"kuake-api-error-w","errorCode":null,"errorMessage":"kuake API error: %w","messagePattern":"kuake API error: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/hunhepan/hunhepan.go","lineNumber":106,"sourceCode":"\t\t}\n\t\tresultChan <- items\n\t}()\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\titems, err := p.searchAPI(client, QkpansoAPI, keyword)\n\t\tif err != nil {\n\t\t\terrChan <- fmt.Errorf(\"qkpanso API error: %w\", err)\n\t\t\treturn\n\t\t}\n\t\tresultChan <- items\n\t}()\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\titems, err := p.searchAPI(client, KuakeAPI, keyword)\n\t\tif err != nil {\n\t\t\terrChan <- fmt.Errorf(\"kuake API error: %w\", err)\n\t\t\treturn\n\t\t}\n\t\tresultChan <- items\n\t}()\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tdebugLog(\"调用 misoso API\")\n\t\titems, err := p.searchAPI(client, MisosoAPI, keyword)\n\t\tif err != nil {\n\t\t\tdebugLog(\"misoso API 错误: %v\", err)\n\t\t\terrChan <- fmt.Errorf(\"misoso API error: %w\", err)\n\t\t\treturn\n\t\t}\n\t\tdebugLog(\"misoso API 返回 %d 条结果\", len(items))\n\t\tresultChan <- items\n\t}()\n","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/hunhepan/hunhepan.go#L88-L124","documentation":"Per-source wrapped error in hunhepan's parallel search fan-out (plugin/hunhepan/hunhepan.go:106): the kuake backend's searchAPI failed; the original error is wrapped with the source name for aggregation into errChan.","triggerScenarios":"p.searchAPI(client, KuakeAPI, keyword) fails during Search: network error, non-2xx status, or response body that cannot be decoded from the kuake endpoint.","commonSituations":"kuake 上游接口超时或返回异常。","solutions":["Check the wrapped cause (transport/status/decode) via errors.Unwrap or logging","Reduce parallel burst pressure or add per-endpoint rate limiting","Confirm the KuakeAPI endpoint and request format are still current","Treat as partial failure and continue with results from the other sources","Add a retry with backoff inside searchAPI for transient errors"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":"func isKuakeAPIError(err error) bool {\n\treturn err != nil && strings.Contains(err.Error(), \"kuake API error\")\n}","tryCatchPattern":"if err != nil && isKuakeAPIError(err) {\n\tlog.Printf(\"kuake source failed, continuing with other sources: %v\", err)\n}","preventionTips":["Verify kuake endpoint contract after upstream schema changes with integration tests","Stagger the parallel goroutines to reduce burst rate-limit risk","Log the unwrapped cause to distinguish timeouts vs decode errors","Keep a source-health flag so dead sources are skipped quickly"],"tags":["api","network","upstream","concurrency"],"backgroundTag":"upstream-api-error","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"}