Skip to content

fix: improve error handling in HttpClientSseClientTransport and add test #391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 13, 2025

Conversation

tzolov
Copy link
Contributor

@tzolov tzolov commented Jul 13, 2025

  • Include response body in error messages for better debugging
  • Change sendHttpPost return type from HttpResponse to HttpResponse
  • Use BodyHandlers.ofString() instead of discarding response body
  • Add testErrorOnBogusMessage test to verify error handling for invalid JSON-RPC messages
  • Test validates that malformed messages return 400 status with descriptive error message

Replace #361

- Include response body in error messages for better debugging
- Change sendHttpPost return type from HttpResponse<Void> to HttpResponse<String>
- Use BodyHandlers.ofString() instead of discarding response body
- Add testErrorOnBogusMessage test to verify error handling for invalid JSON-RPC messages
- Test validates that malformed messages return 400 status with descriptive error message

Replace #361

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>

Co-authored-by: jkma <jkma@trip.com>
@tzolov tzolov added this to the 0.11.0 milestone Jul 13, 2025
@tzolov tzolov merged commit b678de6 into main Jul 13, 2025
1 of 2 checks passed
@tzolov tzolov deleted the gh-361-pr-2 branch July 13, 2025 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant