Skip to content
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

grpc-js: Improve reporting of HTTP error codes #2723

Conversation

murgatroid99
Copy link
Member

This makes a couple of changes to HTTP status code handling:

  1. When surfacing a gRPC error synthesized from an HTTP status code, the details string now contains the actual status code number.
  2. When a call ends with no trailers received and there was a non-OK HTTP status code, surface that error instead of a more generic error about not receiving trailers. This fixes grpc-js doesn't handle HTTP/2 error responses with headers and a body and no trailers #2722.

I also added some information to the "RST_STREAM with code 0" error to explain what it means semantically, and I had to refactor handleTrailers. That refactor does change the behavior slightly, mainly to prioritize the gRPC status over the HTTP status when provided, which I think is more correct behavior.

@murgatroid99 murgatroid99 merged commit 0bbfb92 into grpc:@grpc/grpc-js@1.10.x May 1, 2024
4 of 5 checks passed
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.

None yet

2 participants