Title: feat: Add error logging for HttpClientSseClientTransport by tiaoc · Pull Request #361 · modelcontextprotocol/java-sdk · GitHub
Open Graph Title: feat: Add error logging for HttpClientSseClientTransport by tiaoc · Pull Request #361 · modelcontextprotocol/java-sdk
X Title: feat: Add error logging for HttpClientSseClientTransport by tiaoc · Pull Request #361 · modelcontextprotocol/java-sdk
Description: Modified the HTTP request error handling to now capture and log the response body content (via response.body()) for non-success status codes (non-200/201/202/206), rather than only logging the status code. Motivation and Context When a failed status code is received, the response lacks a body, forcing developers to manually reproduce the issue. How Has This Been Tested? Constructed an improperly configured HTTP client request builder and verified the log message output via unit testing. Breaking Changes Types of changes Bug fix (non-breaking change which fixes an issue) New feature (non-breaking change which adds functionality) Breaking change (fix or feature that would cause existing functionality to change) Documentation update Checklist I have read the MCP Documentation My code follows the repository's style guidelines New and existing tests pass locally I have added appropriate error handling I have added or updated documentation as needed Additional context Using ofString() to read the response body aids in troubleshooting server errors, but incurs serialization overhead (even for trivial bodies like "Accepted"). If maintainers reject this change, the method requires a documentation comment instructing developers to manually inspect the response body during debugging.
Open Graph Description: Modified the HTTP request error handling to now capture and log the response body content (via response.body()) for non-success status codes (non-200/201/202/206), rather than only logging the stat...
X Description: Modified the HTTP request error handling to now capture and log the response body content (via response.body()) for non-success status codes (non-200/201/202/206), rather than only logging the stat...
Opengraph URL: https://github.com/modelcontextprotocol/java-sdk/pull/361
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:61070fff-04b5-9bba-f84f-d407789a3284 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8792:BC261:EC9D9D:155466E:6A5F44CC |
| html-safe-nonce | 5a942648fa4db4473622325d8da7e4cf3dc15871615b62f01992b541cf027cb1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzkyOkJDMjYxOkVDOUQ5RDoxNTU0NjZFOjZBNUY0NENDIiwidmlzaXRvcl9pZCI6IjUxNDI4MzU2MDYyNzcwMTQ3MzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 06cea4647528e634d00951de5c15f0d51dd68ce76975a5d22c6def10e5390b3c |
| hovercard-subject-tag | pull_request:2632185161 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/java-sdk/pull/361/files |
| twitter:image | https://avatars.githubusercontent.com/u/43262039?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/43262039?s=400&v=4 |
| og:image:alt | Modified the HTTP request error handling to now capture and log the response body content (via response.body()) for non-success status codes (non-200/201/202/206), rather than only logging the stat... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | ab2497d9345a59709926b385d88458fa5932c82ec066288448eb68b34cbcbbda |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/java-sdk git https://github.com/modelcontextprotocol/java-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 919609219 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/java-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 919609219 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/java-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ba0ac57287507693938b0a2de45402a22cda0785 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width