You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the server just returns the result, then everything works as it should. But if the server should return an error, then no matter what status code and message the server returns, this code always outputs the following line:
Error code: 2 Message: Response closed without grpc status (headers only)
At the same time, I'm testing the API using the Kreya tool (In normal gprc mode and in grpc-web mode). In this program, all status codes and error messages are displayed correctly.
On the backend I use ASP.NET Core with Grpc.AspNetCore.Web nuget package to support grpc-web
What could be the matter that the error status code and the message are always the same?
The text was updated successfully, but these errors were encountered:
Seems like the library doesn't like the way that errors are sent from the backend. Could you include a copy of the body of the response when you get this error? In grpc-web the status should be included at the end of the body. Maybe it's encoded in an unexpected way?
I had the same problem and the reason was CORS. Without access-control-expose-headers header the client is not allowed to read the grpc headers and returns the message you mentioned.
I am using the following code to get the result of executing a unary grpc request from a client.
When the server just returns the result, then everything works as it should. But if the server should return an error, then no matter what status code and message the server returns, this code always outputs the following line:
Error code: 2 Message: Response closed without grpc status (headers only)
At the same time, I'm testing the API using the Kreya tool (In normal gprc mode and in grpc-web mode). In this program, all status codes and error messages are displayed correctly.
On the backend I use ASP.NET Core with Grpc.AspNetCore.Web nuget package to support grpc-web
What could be the matter that the error status code and the message are always the same?
The text was updated successfully, but these errors were encountered: