fish2018/pansou · warning

[ ] 未找到相关结果

Error message

[%s] 未找到相关结果

What it means

After a successful search request, searchImpl checks whether Lou1 returned any threads. If the parsed result list is empty it raises this error because there is nothing to fan out over. It distinguishes 'request worked, no matches' from request failures.

Solutions

  1. Retry with a broader or corrected keyword
  2. Verify the term exists on the Lou1 site in a browser
  3. Check whether the plugin's search URL/parameters are still valid after a site redesign
  4. Treat as a normal empty result in your caller rather than a hard failure

Example fix

// before
results, err := lou1.Search(kw)
if err != nil { return err }
// after
results, err := lou1.Search(kw)
if err != nil {
    if strings.Contains(err.Error(), "未找到相关结果") { return nil, nil }
    return err
}
Defensive patterns

Strategy: fallback

Try / catch

results, err := lou1.Search(kw)
if err != nil && strings.Contains(err.Error(), "未找到相关结果") {
    return tryAlternatePlugins(kw) // fall back to other sources
}

Prevention

When it happens

Trigger: The upstream search JSON parsed fine but contained zero hits for the keyword (len(threads)==0).

Common situations: Very obscure or misspelled search terms; upstream index does not yet contain the title; site changed its search scope so common terms return nothing.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


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

Appendix: source

Thrown at plugin/lou1/lou1.go:113

	return p.AsyncSearchWithResult(keyword, p.searchImpl, p.MainCacheKey, ext)
}

func (p *Lou1Plugin) searchImpl(client *http.Client, keyword string, ext map[string]interface{}) ([]model.SearchResult, error) {
	if p.client != nil {
		client = p.client
	}

	searchKeyword := strings.TrimSpace(keyword)
	if searchKeyword == "" {
		return nil, fmt.Errorf("[%s] 关键词不能为空", p.Name())
	}

	threads, err := p.fetchSearchResults(client, searchKeyword)
	if err != nil {
		return nil, err
	}
	if len(threads) == 0 {
		return nil, fmt.Errorf("[%s] 未找到相关结果", p.Name())
	}

	var (
		wg      sync.WaitGroup
		resultM sync.Mutex
		results []model.SearchResult
		sem     = make(chan struct{}, detailWorkers)
	)

	for _, thread := range threads {
		thread := thread
		wg.Add(1)
		sem <- struct{}{}

		go func() {
			defer wg.Done()
			defer func() { <-sem }()

View on GitHub (pinned to beaa561337)