fish2018/pansou · error
kuake API error
Error message
kuake API error: %w
What it means
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.
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
Defensive patterns
Strategy: fallback
Type guard
func isKuakeAPIError(err error) bool {
return err != nil && strings.Contains(err.Error(), "kuake API error")
} Try / catch
if err != nil && isKuakeAPIError(err) {
log.Printf("kuake source failed, continuing with other sources: %v", err)
} Prevention
- 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
When it happens
Trigger: p.searchAPI(client, KuakeAPI, keyword) fails during Search: network error, non-2xx status, or response body that cannot be decoded from the kuake endpoint.
Common situations: kuake 上游接口超时或返回异常。
Related errors
AI-assisted analysis of fish2018/pansou@beaa561337 (2026-09-07).
Data as JSON: /api/errors/1e792caed6b9cf09.
Report an issue: GitHub.
Appendix: source
Thrown at plugin/hunhepan/hunhepan.go:106
}
resultChan <- items
}()
go func() {
defer wg.Done()
items, err := p.searchAPI(client, QkpansoAPI, keyword)
if err != nil {
errChan <- fmt.Errorf("qkpanso API error: %w", err)
return
}
resultChan <- items
}()
go func() {
defer wg.Done()
items, err := p.searchAPI(client, KuakeAPI, keyword)
if err != nil {
errChan <- fmt.Errorf("kuake API error: %w", err)
return
}
resultChan <- items
}()
go func() {
defer wg.Done()
debugLog("调用 misoso API")
items, err := p.searchAPI(client, MisosoAPI, keyword)
if err != nil {
debugLog("misoso API 错误: %v", err)
errChan <- fmt.Errorf("misoso API error: %w", err)
return
}
debugLog("misoso API 返回 %d 条结果", len(items))
resultChan <- items
}()
View on GitHub (pinned to beaa561337)