{"record":{"id":"e250bfb775bbde76","repo":"fish2018/pansou","slug":"d-e250bf","errorCode":null,"errorMessage":"搜索结果请求失败，状态码: %d","messagePattern":"搜索结果请求失败，状态码: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/clxiong/clxiong.go","lineNumber":233,"sourceCode":"\t\tresp, lastErr = client.Do(req)\n\t\tif lastErr == nil && resp.StatusCode == 200 {\n\t\t\tbreak\n\t\t}\n\t\tif resp != nil {\n\t\t\tresp.Body.Close()\n\t\t}\n\t\tif i < MaxRetries-1 {\n\t\t\ttime.Sleep(RetryDelay)\n\t\t}\n\t}\n\n\tif lastErr != nil {\n\t\treturn nil, lastErr\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != 200 {\n\t\treturn nil, fmt.Errorf(\"搜索结果请求失败，状态码: %d\", resp.StatusCode)\n\t}\n\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn p.parseSearchResults(string(body))\n}\n\n// parseSearchResults 解析搜索结果页面\nfunc (p *ClxiongPlugin) parseSearchResults(html string) ([]model.SearchResult, error) {\n\tdoc, err := goquery.NewDocumentFromReader(strings.NewReader(html))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar results []model.SearchResult","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/clxiong/clxiong.go#L215-L251","documentation":"getSearchResults fetches the search-results page after obtaining a searchid and requires HTTP 200. Any other status code aborts with this error naming the actual status. It signals the results request failed at the HTTP level (rate limiting, blocking, server error, expired searchid).","triggerScenarios":"SearchWithResult proceeds to getSearchResults and the results request returns a non-200 status, e.g. 403 (anti-bot), 404 (expired/invalid searchid), 429 (rate limit), or 5xx.","commonSituations":"Too-frequent searches trigger rate limiting; the searchid expired between the two requests; the site blocks datacenter IPs; upstream outage returning 502/503.","solutions":["Log the status code and retry with backoff for transient codes (429, 5xx) — the surrounding code already retries, so check retry limits.","Inspect whether the searchid is being used promptly after retrieval; re-fetch it if it expired.","Add realistic headers (User-Agent, Referer, cookies) to avoid 403 anti-bot responses.","Check upstream availability directly (curl -i) to distinguish blocking from an outage."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"var res []model.SearchResult\nerr := retry(3, time.Second, func() error {\n    var e error\n    res, e = client.SearchWithResult(ctx, keyword)\n    return e\n})\nif err != nil {\n    // all attempts got non-200: surface status or switch upstream\n}","preventionTips":["Rate-limit your search frequency to avoid 429s","Use the searchid immediately after obtaining it so it doesn't expire","Send realistic headers/cookies to avoid 403 anti-bot responses","Monitor upstream availability and fall back to alternate sources"],"tags":["http","status-code","go","network"],"backgroundTag":"http-error-status","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"}