{"record":{"id":"97a66bc745f45a17","repo":"fish2018/pansou","slug":"s-97a66b","errorCode":null,"errorMessage":"[%s] 未找到相关结果","messagePattern":"\\[(.+?)\\] 未找到相关结果","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"plugin/yiove/yiove.go","lineNumber":128,"sourceCode":"\t\t}\n\t}\n\n\tsearchKeyword := strings.TrimSpace(keyword)\n\tif searchKeyword == \"\" {\n\t\treturn nil, fmt.Errorf(\"[%s] 关键词不能为空\", p.Name())\n\t}\n\n\tlogDebug(debug, \"[%s] 开始搜索，关键词=%s\", p.Name(), searchKeyword)\n\n\tthreads, err := p.fetchSearchResults(client, searchKeyword, debug)\n\tif err != nil {\n\t\tlogDebug(debug, \"[%s] 搜索阶段报错: %v\", p.Name(), err)\n\t\treturn nil, err\n\t}\n\tlogDebug(debug, \"[%s] 搜索结果数量=%d\", p.Name(), len(threads))\n\tif len(threads) == 0 {\n\t\tlogDebug(debug, \"[%s] 搜索结果为空\", p.Name())\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{}, detailWorkerCount)\n\t\tresultM sync.Mutex\n\t\tresults []model.SearchResult\n\t)\n\n\tfor _, thread := range threads {\n\t\tthread := thread\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":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/yiove/yiove.go#L110-L146","documentation":"Empty-result guard in yiove searchImpl: the search HTTP call succeeded but returned zero threads. Distinct from a transport error — the site answered and simply had no matches (or rendered none parseable) for the keyword.","triggerScenarios":"fetchSearchResults successfully parses the search page but returns 0 threads — keyword has no matches, results are behind a login/permission wall, or the page HTML changed so the parser matches nothing.","commonSituations":"Very niche or misspelled keywords; forum requires login to see results; site redesign breaks the extraction selectors so all results are silently dropped; keyword filtered out by the forum's own search rules.","solutions":["Try a broader or alternative keyword to confirm the term exists on the site","Open the search URL in a browser and verify results are publicly visible (not login-gated)","If the site was redesigned, update fetchSearchResults' HTML selectors to the new layout","Treat this as an expected empty state in the caller rather than retrying"],"exampleFix":"// before\nresults, err := plugin.Search(ctx, keyword)\nif err != nil { return err }\n// after\nresults, err := plugin.Search(ctx, keyword)\nif err != nil {\n    if strings.Contains(err.Error(), \"未找到相关结果\") {\n        return nil // graceful empty state\n    }\n    return err\n}","handlingStrategy":"fallback","validationCode":"// cannot pre-validate; guard after the call\nif err != nil && strings.Contains(err.Error(), \"未找到相关结果\") { /* empty state */ }","typeGuard":"func isEmptyResultsErr(err error) bool { return err != nil && strings.Contains(err.Error(), \"未找到相关结果\") }","tryCatchPattern":"results, err := plugin.Search(ctx, keyword)\nif isEmptyResultsErr(err) {\n    return []Result{}, nil // graceful empty state, maybe try another plugin\n}\nif err != nil { return err }","preventionTips":["Treat empty results as an expected state, not a crash — branch on the message","Try alternate or broader keywords before concluding no data exists","Check in a browser whether results require login on the target site","Monitor for sudden zero-result rates, which usually means the page layout changed"],"tags":["empty-results","search","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"}