{"record":{"id":"0d03dddc04eac37e","repo":"fish2018/pansou","slug":"s-d-0d03dd","errorCode":null,"errorMessage":"[%s] 接口返回状态码: %d","messagePattern":"\\[(.+?)\\] 接口返回状态码: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/jupansou/jupansou.go","lineNumber":122,"sourceCode":"\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"[%s] 创建请求失败: %w\", p.Name(), err)\n\t}\n\treq.Header.Set(\"User-Agent\", \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36\")\n\treq.Header.Set(\"Accept\", \"text/event-stream\")\n\treq.Header.Set(\"Accept-Language\", \"zh-CN,zh;q=0.9,en;q=0.8\")\n\treq.Header.Set(\"Connection\", \"keep-alive\")\n\treq.Header.Set(\"Referer\", jupansouBaseURL+\"/\")\n\treq.Header.Set(\"Origin\", jupansouBaseURL)\n\treq.Header.Set(\"X-Requested-With\", \"XMLHttpRequest\")\n\n\tresp, err := doJuPansouRequestWithRetry(req, client)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"[%s] 请求失败: %w\", p.Name(), err)\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"[%s] 接口返回状态码: %d\", p.Name(), resp.StatusCode)\n\t}\n\n\titems := make([]juPansouStreamItem, 0)\n\tscanner := bufio.NewScanner(resp.Body)\n\tscanner.Buffer(make([]byte, 0, 64*1024), 1024*1024)\n\tfor scanner.Scan() {\n\t\tline := strings.TrimSpace(scanner.Text())\n\t\tif !strings.HasPrefix(line, \"data:\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tpayload := strings.TrimSpace(strings.TrimPrefix(line, \"data:\"))\n\t\tif payload == \"\" || payload == \"[DONE]\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar item juPansouStreamItem\n\t\tif err := json.Unmarshal([]byte(payload), &item); err != nil {","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/jupansou/jupansou.go#L104-L140","documentation":"searchImpl returns this when the JuPansou endpoint responds with a status code other than 200. The response body is discarded, so only the numeric code is reported. It indicates the server rejected the request (rate limit, auth, moved endpoint, WAF block).","triggerScenarios":"doJuPansouRequestWithRetry succeeds at transport level but resp.StatusCode != http.StatusOK — e.g. 403 from anti-bot WAF, 429 rate limit, 5xx server error.","commonSituations":"Cloudflare/WAF challenge pages returned as 403; request rate too high causing 429; upstream API version change returning 404/410; server-side outage producing 502/503.","solutions":["Read the reported status code: 403/429 usually mean anti-bot or rate limiting — reduce request frequency or improve headers/cookies.","Ensure the search session (ensureSearchSession) ran so required cookies are present.","curl the endpoint with the same headers to see the raw response body for clues.","Update the plugin if the endpoint moved (404).","Retry later for transient 5xx."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"results, err := p.searchImpl(client, keyword)\nif err != nil {\n    var statusErr *fmt.wrapError\n    if strings.Contains(err.Error(), \"接口返回状态码\") {\n        log.Printf(\"jupansou returned non-200, backing off before retry: %v\", err)\n        time.Sleep(backoff)\n        results, err = p.searchImpl(client, keyword)\n    }\n    if err != nil { return fallbackResults }\n}","preventionTips":["Throttle request rate to stay under upstream limits.","Maintain realistic browser headers and a valid session before searching.","Alert on non-200 rates to detect WAF blocks or API deprecations early."],"tags":["http","status-code","upstream","rate-limit"],"backgroundTag":"http-non-200-response","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"}