{"record":{"id":"40de21662176f289","repo":"fish2018/pansou","slug":"w-40de21","errorCode":null,"errorMessage":"执行搜索失败: %w","messagePattern":"执行搜索失败: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/xys/xys.go","lineNumber":113,"sourceCode":"func (p *XysPlugin) searchImpl(client *http.Client, keyword string, ext map[string]interface{}) ([]model.SearchResult, error) {\n\tif p.debugMode {\n\t\tlog.Printf(\"[XYS] 开始搜索: %s\", keyword)\n\t}\n\n\t// 第一步：获取token\n\ttoken, err := p.getToken(client, keyword)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"获取token失败: %w\", err)\n\t}\n\n\tif p.debugMode {\n\t\tlog.Printf(\"[XYS] 获取到token: %s\", token[:10]+\"...\")\n\t}\n\n\t// 第二步：执行搜索\n\tresults, err := p.executeSearch(client, token, keyword)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"执行搜索失败: %w\", err)\n\t}\n\n\tif p.debugMode {\n\t\tlog.Printf(\"[XYS] 搜索完成，获取到 %d 个结果\", len(results))\n\t}\n\n\treturn results, nil\n}\n\n// getToken 获取搜索token\nfunc (p *XysPlugin) getToken(client *http.Client, keyword string) (string, error) {\n\t// 检查缓存\n\tcacheKey := \"token\"\n\tif cached, found := p.tokenCache.Load(cacheKey); found {\n\t\tif tokenCache, ok := cached.(TokenCache); ok {\n\t\t\t// 检查是否过期\n\t\t\tif time.Since(tokenCache.Timestamp) < p.cacheTTL {\n\t\t\t\tif p.debugMode {","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/xys/xys.go#L95-L131","documentation":"Wrapped stage failure in XysPlugin.searchImpl (plugin/xys/xys.go:113): the executeSearch step (which runs after the token was successfully obtained) failed; the underlying error is wrapped, meaning token acquisition succeeded but the search request/parse did not.","triggerScenarios":"Thrown at plugin/xys/xys.go:113 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the executeSearch cause","Retry — the token may be reusable, avoiding a re-fetch","Update response parsing if the API changed"],"exampleFix":null,"handlingStrategy":"retry","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"}