fish2018/pansou · error

misoso API error

Error message

misoso API error: %w

What it means

Per-source wrapped error in hunhepan's parallel search fan-out (plugin/hunhepan/hunhepan.go:118): the misoso backend's searchAPI failed; the underlying error is wrapped with the source name and sent to errChan while other API goroutines continue.

Solutions

  1. Read the wrapped error / debug log ("misoso API 错误") for the root cause
  2. Verify the MisosoAPI URL and payload against the live API
  3. Add retry/backoff for transient failures
  4. Proceed with results from the other three endpoints (partial-failure tolerant aggregation)
  5. If persistent, update or disable the misoso source in the plugin
Defensive patterns

Strategy: fallback

Type guard

func isMisosoAPIError(err error) bool {
	return err != nil && strings.Contains(err.Error(), "misoso API error")
}

Try / catch

if err != nil && isMisosoAPIError(err) {
	log.Printf("misoso source failed: %v", err) // other sources still usable
}

Prevention

When it happens

Trigger: p.searchAPI(client, MisosoAPI, keyword) returns an error: HTTP failure, non-2xx response, or JSON decode error from the misoso endpoint during a keyword search.

Common situations: misoso 上游接口变更或超时。

Related errors


AI-assisted analysis of fish2018/pansou@beaa561337 (2026-09-07). Data as JSON: /api/errors/01c068820b1d0b65. Report an issue: GitHub.

Appendix: source

Thrown at plugin/hunhepan/hunhepan.go:118

	}()

	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
	}()

	// 启动一个goroutine等待所有请求完成并关闭通道
	go func() {
		wg.Wait()
		close(resultChan)
		close(errChan)
	}()

	// 收集结果
	var allItems []HunhepanItem
	var errors []error

	// 从通道读取结果

View on GitHub (pinned to beaa561337)