{"record":{"id":"57b4abf3befe4413","repo":"fish2018/pansou","slug":"w-57b4ab","errorCode":null,"errorMessage":"搜索第一页失败: %w","messagePattern":"搜索第一页失败: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/panwiki/panwiki.go","lineNumber":83,"sourceCode":"\treturn searchURL\n}\n\n// switchToBackupDomain 切换到备用域名\nfunc (p *PanwikiPlugin) switchToBackupDomain() {\n\tif p.currentBaseURL == PrimaryBaseURL {\n\t\tp.currentBaseURL = BackupBaseURL\n\t\tif p.debugMode {\n\t\t\tlog.Printf(\"[Panwiki] 切换到备用域名: %s\", p.currentBaseURL)\n\t\t}\n\t}\n}\n\n// searchImpl 实现搜索逻辑\nfunc (p *PanwikiPlugin) searchImpl(client *http.Client, keyword string, ext map[string]interface{}) ([]model.SearchResult, error) {\n\t// 第一页搜索\n\tfirstPageResults, err := p.searchPage(client, keyword, 1)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"搜索第一页失败: %w\", err)\n\t}\n\n\tvar allResults []model.SearchResult\n\tallResults = append(allResults, firstPageResults...)\n\n\t// 多页并发搜索\n\tif MaxPages > 1 {\n\t\tvar wg sync.WaitGroup\n\t\tvar mu sync.Mutex\n\t\tsemaphore := make(chan struct{}, MaxConcurrency)\n\t\tpageResults := make(map[int][]model.SearchResult)\n\n\t\tfor page := 2; page <= MaxPages; page++ {\n\t\t\twg.Add(1)\n\t\t\tgo func(pageNum int) {\n\t\t\t\tdefer wg.Done()\n\t\t\t\tsemaphore <- struct{}{}\n\t\t\t\tdefer func() { <-semaphore }()","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/panwiki/panwiki.go#L65-L101","documentation":"Wrapped first-page failure in PanwikiPlugin.searchImpl (plugin/panwiki/panwiki.go:83): the initial search page request failed (including any backup-domain retry inside searchPage), so pagination never starts. Underlying cause is wrapped via %w.","triggerScenarios":"Thrown at plugin/panwiki/panwiki.go:83 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["确认主域名可用并让 searchPage 自动切换备用域名","增加重试与超时时间","失败时返回友好错误提示"],"exampleFix":null,"handlingStrategy":"fallback","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"}