{"record":{"id":"f64f1d06136b349d","repo":"fish2018/pansou","slug":"qkpanso-api-error-w","errorCode":null,"errorMessage":"qkpanso API error: %w","messagePattern":"qkpanso API error: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/hunhepan/hunhepan.go","lineNumber":96,"sourceCode":"\tvar wg sync.WaitGroup\n\twg.Add(4)\n\n\t// 并行请求三个API\n\tgo func() {\n\t\tdefer wg.Done()\n\t\titems, err := p.searchAPI(client, HunhepanAPI, keyword)\n\t\tif err != nil {\n\t\t\terrChan <- fmt.Errorf(\"hunhepan 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, 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\")","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/hunhepan/hunhepan.go#L78-L114","documentation":"Per-source wrapped error in hunhepan's parallel search fan-out (plugin/hunhepan/hunhepan.go:96): the qkpanso backend's searchAPI failed and its error is wrapped with the source name before being pushed to errChan. One of several concurrent upstream APIs; other sources may still succeed.","triggerScenarios":"p.searchAPI(client, QkpansoAPI, keyword) returns an error during a Search call — request build failure, HTTP error, non-2xx response, or JSON decode error from the qkpanso endpoint.","commonSituations":"qkpanso 上游接口宕机或超时；该分支限流。","solutions":["Inspect the wrapped error to distinguish transport vs HTTP status vs decode failure","Validate the QkpansoAPI URL and payload against the current upstream API","Add retry/backoff for transient 5xx/timeouts","Rely on the other three API results (aggregation tolerates one failure)","If persistent, update the plugin to the new qkpanso endpoint or disable this source"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":"func isQkpansoAPIError(err error) bool {\n\treturn err != nil && strings.Contains(err.Error(), \"qkpanso API error\")\n}","tryCatchPattern":"if err != nil && isQkpansoAPIError(err) {\n\tlog.Printf(\"qkpanso source unavailable, using remaining sources: %v\", err)\n}","preventionTips":["Treat each of the four sources as individually fallible","Alert on persistent single-source failures (endpoint moved/dead)","Update the qkpanso endpoint when upstream redesigns its API","Cap concurrent per-source requests to stay under rate limits"],"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"}