{"record":{"id":"0e0c2a7a017421ac","repo":"router-for-me/CLIProxyAPI","slug":"failed-to-create-refresh-request-w","errorCode":null,"errorMessage":"failed to create refresh request: %w","messagePattern":"failed to create refresh request: %w","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/auth/claude/anthropic_auth.go","lineNumber":540,"sourceCode":"\t\t\tretryable: false,\n\t\t}\n\t}\n\n\treqBody := map[string]interface{}{\n\t\t\"client_id\":     ClientID,\n\t\t\"grant_type\":    \"refresh_token\",\n\t\t\"refresh_token\": refreshToken,\n\t\t\"scope\":         ClaudeOAuthScope,\n\t}\n\n\tjsonBody, err := json.Marshal(reqBody)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to marshal request body: %w\", err)\n\t}\n\n\treq, err := http.NewRequestWithContext(ctx, \"POST\", RefreshTokenURL, strings.NewReader(string(jsonBody)))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create refresh request: %w\", err)\n\t}\n\tapplyClaudeOAuthAxiosHeaders(req)\n\n\tresp, err := o.httpClient.Do(req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"token refresh request failed: %w\", err)\n\t}\n\tdefer func() {\n\t\t_ = resp.Body.Close()\n\t}()\n\n\tbody, err := readClaudeOAuthResponseBody(resp)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read refresh response: %w\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusOK {\n\t\tmessage := string(body)","sourceCodeStart":522,"sourceCodeEnd":558,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/auth/claude/anthropic_auth.go#L522-L558","documentation":"Error \"failed to create refresh request: %w\" thrown in router-for-me/CLIProxyAPI.","triggerScenarios":"Thrown at internal/auth/claude/anthropic_auth.go:540 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the refresh endpoint URL and HTTP client configuration.","Check the wrapped error for request construction details."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}