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

feat: expose invalid argument error to clients in bidirectional streaming (#4795) #4819

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove for loop
  • Loading branch information
Ian Lee authored and Ian Lee committed Oct 16, 2024
commit 690ed314b2ef058838e8acf0107eda0e78f98d0d
15 changes: 7 additions & 8 deletions examples/internal/proto/examplepb/flow_combination.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 7 additions & 8 deletions examples/internal/proto/examplepb/stream.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions protoc-gen-grpc-gateway/internal/gengateway/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,13 +741,12 @@ func Register{{$svc.GetName}}{{$.RegisterFuncSuffix}}Client(ctx context.Context,
}
{{- if and $m.GetClientStreaming $m.GetServerStreaming }}
go func() {
for err := range reqErrChan {
if err != io.EOF {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
}
if err := resp.CloseSend(); err != nil {
grpclog.Errorf("Failed to terminate client stream: %v", err)
}
err := <-reqErrChan
if err != io.EOF {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
}
if err := resp.CloseSend(); err != nil {
grpclog.Errorf("Failed to terminate client stream: %v", err)
}
}()
{{- end }}
Expand Down
Loading