{"record":{"id":"ca12acd67a025768","repo":"fish2018/pansou","slug":"s-ca12ac","errorCode":null,"errorMessage":"[%s] 未找到相关资源","messagePattern":"\\[(.+?)\\] 未找到相关资源","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"plugin/mizixing/mizixing.go","lineNumber":111,"sourceCode":"\treturn p.AsyncSearchWithResult(keyword, p.searchImpl, p.MainCacheKey, ext)\n}\n\nfunc (p *MizixingPlugin) searchImpl(client *http.Client, keyword string, ext map[string]interface{}) ([]model.SearchResult, error) {\n\tif p.client != nil {\n\t\tclient = p.client\n\t}\n\n\tsearchKeyword := strings.TrimSpace(keyword)\n\tif searchKeyword == \"\" {\n\t\treturn nil, fmt.Errorf(\"[%s] 关键词不能为空\", p.Name())\n\t}\n\n\titems, err := p.fetchSearchResults(client, searchKeyword)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(items) == 0 {\n\t\treturn nil, fmt.Errorf(\"[%s] 未找到相关资源\", p.Name())\n\t}\n\n\tvar (\n\t\twg      sync.WaitGroup\n\t\tsem     = make(chan struct{}, detailWorkers)\n\t\tresultM sync.Mutex\n\t\tresults []model.SearchResult\n\t)\n\n\tfor _, item := range items {\n\t\titem := item\n\t\twg.Add(1)\n\t\tsem <- struct{}{}\n\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\tdefer func() { <-sem }()\n","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/mizixing/mizixing.go#L93-L129","documentation":"The plugin fetched and parsed the mizixing search results page but found zero result items. It treats \"site reachable but no matches\" as an error rather than returning an empty slice, so callers get this error for queries with no hits on the site.","triggerScenarios":"searchImpl calls fetchSearchResults successfully, but doc.Find(\"article.excerpt\") matches nothing — query has no matches on the site, or the site's HTML layout changed.","commonSituations":"Obscure/typo'd search terms; site redesign removing the article.excerpt selector; bot-walls serving empty shells.","solutions":["Retry with broader or corrected search keywords.","Verify the site still uses article.excerpt markup; update the CSS selector if it changed.","Treat empty results as empty output instead of an error if desired by changing the caller."],"exampleFix":"// before\nif len(items) == 0 {\n    return nil, fmt.Errorf(\"[%s] 未找到相关资源\", p.Name())\n}\n// after\nif len(items) == 0 {\n    return plugin.FilterResultsByKeyword(nil, searchKeyword), nil\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"results, err := mizixingSearch(ctx, keyword)\nif err != nil && strings.Contains(err.Error(), \"未找到相关资源\") {\n    return nil, nil // treat as no matches\n}","preventionTips":["Check selectors (article.excerpt) against the live site periodically.","Suggest broader keywords when no results are found.","Handle \"no results\" as a normal UX state, not a crash."],"tags":["search","empty-results","scraping"],"backgroundTag":"empty-result-set","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"}