{"record":{"id":"5b97bec2c91c3cc5","repo":"github/github-mcp-server","slug":"failed-to-read-response-body-w-5b97be","errorCode":null,"errorMessage":"failed to read response body: %w","messagePattern":"failed to read response body: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/github/pullrequests.go","lineNumber":183,"sourceCode":"\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get repo access cache: %w\", err)\n\t}\n\tff := deps.GetFlags(ctx)\n\n\tpr, resp, err := client.PullRequests.Get(ctx, owner, repo, pullNumber)\n\tif err != nil {\n\t\treturn ghErrors.NewGitHubAPIErrorResponse(ctx,\n\t\t\t\"failed to get pull request\",\n\t\t\tresp,\n\t\t\terr,\n\t\t), nil\n\t}\n\tdefer func() { _ = resp.Body.Close() }()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\tbody, err := io.ReadAll(resp.Body)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to read response body: %w\", err)\n\t\t}\n\t\treturn ghErrors.NewGitHubAPIStatusErrorResponse(ctx, \"failed to get pull request\", resp, body), nil\n\t}\n\n\t// sanitize title/body on response\n\tif pr != nil {\n\t\tif pr.Title != nil {\n\t\t\tpr.Title = github.Ptr(sanitize.Sanitize(*pr.Title))\n\t\t}\n\t\tif pr.Body != nil {\n\t\t\tpr.Body = github.Ptr(sanitize.Sanitize(*pr.Body))\n\t\t}\n\t}\n\n\tif ff.LockdownMode {\n\t\tif restricted, err := authorLockdownResult(ctx, cache, owner, repo, pr.GetUser().GetLogin(), lockdownPullRequestRestrictedMessage); restricted != nil || err != nil {\n\t\t\treturn restricted, err\n\t\t}","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/pullrequests.go#L165-L201","documentation":"Error \"failed to read response body: %w\" thrown in github/github-mcp-server.","triggerScenarios":"Thrown at pkg/github/pullrequests.go:183 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}