-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Error message on server streaming endpoint does not get delimiter appended #2591
Comments
I'm kinda leaning towards this not being a bug, but what is the behavior for successful streams? Does the last message include the delimiter at the end? If so, we should probably include it in errors as well. |
Yes - the last message includes a delimiter if it is not an error response. When an error is returned:
When no error is returned
|
In that case I think you're right, we should add the delimiter after the error. It hopefully shouldn't break any clients. Would you be willing to contribute this fix? |
Hi @johanbrandhorst, I'm trying to make my first contribution and I think I solved the issue. Just posted PR #2596 |
@stelcodes looks like you beat me to it :) TYVM <3 |
🐛 Bug Report
When calling a Server Streaming grpc endpoint through grpc-gateway, when an error is returned, it does not have a delimiter appended (by default,
\n
) unlike other streaming messages.To Reproduce
Expected behavior
grpc-gateway returns
{"error":....}\n
(or other configured delimiter)Actual Behavior
grpc-gateway returns
{"error":....}
(without the configured delimiter)Your Environment
Mac OS 12.2.1, Go 1.17.6, grpc-gateway v2.8.0, google.golang.org/grpc v1.45.0
Note
Am aware this might not be a "bug" - the behaviour is always the same when passing errors, so it might be as designed. If that's the case, please don't hesitate to tell me so :D
Should this be considered a bug, am happy to try to get a PR in as well.
The text was updated successfully, but these errors were encountered: