{"record":{"id":"9a372dd86ed3f488","repo":"fish2018/pansou","slug":"s-9a372d","errorCode":null,"errorMessage":"[%s] 搜索关键词不能为空","messagePattern":"\\[(.+?)\\] 搜索关键词不能为空","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/yulinshufa/yulinshufa.go","lineNumber":137,"sourceCode":"\t\treturn nil, err\n\t}\n\treturn result.Results, nil\n}\n\n// SearchWithResult 返回带IsFinal的结果\nfunc (p *YulinshufaPlugin) SearchWithResult(keyword string, ext map[string]interface{}) (model.PluginSearchResult, error) {\n\treturn p.AsyncSearchWithResult(keyword, p.searchImpl, p.MainCacheKey, ext)\n}\n\nfunc (p *YulinshufaPlugin) searchImpl(client *http.Client, keyword string, ext map[string]interface{}) ([]model.SearchResult, error) {\n\tsearchKeyword := strings.TrimSpace(keyword)\n\tif ext != nil {\n\t\tif titleEn, ok := ext[\"title_en\"].(string); ok && strings.TrimSpace(titleEn) != \"\" {\n\t\t\tsearchKeyword = strings.TrimSpace(titleEn)\n\t\t}\n\t}\n\tif searchKeyword == \"\" {\n\t\treturn nil, fmt.Errorf(\"[%s] 搜索关键词不能为空\", p.Name())\n\t}\n\tp.debugf(\"开始搜索, keyword=%s\", searchKeyword)\n\n\titems, err := p.fetchSearchItems(client, searchKeyword)\n\tif err != nil {\n\t\tp.debugf(\"搜索请求失败: %v\", err)\n\t\treturn nil, err\n\t}\n\tif len(items) == 0 {\n\t\tp.debugf(\"搜索结果为空\")\n\t\treturn []model.SearchResult{}, nil\n\t}\n\tp.debugf(\"搜索解析到 %d 条候选结果\", len(items))\n\n\tresults := p.fetchDetailResults(items)\n\tvalidResults := make([]model.SearchResult, 0, len(results))\n\tfor _, res := range results {\n\t\tif len(res.Links) == 0 {","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/yulinshufa/yulinshufa.go#L119-L155","documentation":"Sentinel validation error in YulinshufaPlugin.searchImpl (plugin/yulinshufa/yulinshufa.go:137): the keyword is empty after trimming (and title_en fallback produced nothing usable), so the search is skipped before any request.","triggerScenarios":"Thrown at plugin/yulinshufa/yulinshufa.go:137 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reject empty keywords at the entry point before invoking the plugin","Skip the plugin for blank inputs instead of erroring"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}