{"record":{"id":"e399c38763bd0f72","repo":"fish2018/pansou","slug":"s","errorCode":null,"errorMessage":"[%s] 未找到相关资源","messagePattern":"\\[(.+?)\\] 未找到相关资源","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"plugin/daishudj/daishudj.go","lineNumber":210,"sourceCode":"\t\t\t\tUniqueID: fmt.Sprintf(\"%s-%s\", p.Name(), postID),\n\t\t\t\tTitle:    title,\n\t\t\t\tContent:  summary,\n\t\t\t\tLinks:    links,\n\t\t\t\tTags:     tags,\n\t\t\t\tChannel:  \"\",\n\t\t\t\tDatetime: publish,\n\t\t\t}\n\n\t\t\tmu.Lock()\n\t\t\tresults = append(results, result)\n\t\t\tmu.Unlock()\n\t\t}(title, detailURL, summary, postID, append([]string{}, tags...), publishTime)\n\t})\n\n\twg.Wait()\n\n\tif len(results) == 0 {\n\t\treturn nil, fmt.Errorf(\"[%s] 未找到相关资源\", p.Name())\n\t}\n\n\treturn plugin.FilterResultsByKeyword(results, keyword), nil\n}\n\nfunc (p *DaishuPlugin) fetchDetailLinks(client *http.Client, detailURL, postID string) []model.Link {\n\tif cached, ok := detailCache.Load(postID); ok {\n\t\tif entry, valid := cached.(cacheEntry); valid {\n\t\t\tif time.Now().Before(entry.expiresAt) && len(entry.links) > 0 {\n\t\t\t\treturn entry.links\n\t\t\t}\n\t\t\tdetailCache.Delete(postID)\n\t\t}\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), detailTimeout)\n\tdefer cancel()\n","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/daishudj/daishudj.go#L192-L228","documentation":"The Daishu plugin's searchImpl gathers results concurrently (worker goroutines with a WaitGroup) and, after wg.Wait(), checks whether the results slice is empty. If no items were parsed for the keyword, it returns this error carrying the plugin name. It is the plugin's way of signaling that the upstream site yielded zero matches rather than a transport failure.","triggerScenarios":"Called automatically when AsyncSearchWithResult invokes p.searchImpl and every worker finished but appended nothing to results — e.g. the keyword has no posts on the site, or the detail-fetch goroutines all discarded the post because detailURL/postID extraction produced nothing.","commonSituations":"Searching an obscure or very new keyword that the Daishu site has not indexed; the site changed its HTML layout so selectors silently match nothing; keyword filtering upstream removed all candidates before the plugin saw them.","solutions":["Verify the keyword actually exists on the daishudj site by searching it manually in a browser.","Check upstream HTML layout changes and update the plugin's selectors so results are parsed again.","Treat the error as an expected no-match condition in the caller instead of retrying.","Enable plugin debug/logging to inspect what the detail fetchers extracted."],"exampleFix":"// before\nresults, err := p.Search(keyword)\nif err != nil { log.Fatal(err) }\n// after\nresults, err := p.Search(keyword)\nif err != nil {\n    if strings.Contains(err.Error(), \"未找到相关资源\") {\n        results = []model.SearchResult{} // no match is not fatal\n    } else {\n        log.Fatal(err)\n    }\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"results, err := plugin.Search(keyword)\nif err != nil {\n    if strings.Contains(err.Error(), \"未找到相关资源\") {\n        return []model.SearchResult{}, nil // treat as no match\n    }\n    return err\n}","preventionTips":["Pre-check keyword popularity on the site before batch searching.","Never treat zero-result searches as retryable failures.","Keep plugin selectors updated when the site layout changes."],"tags":["search","empty-results","plugin","go"],"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"}