Skip to content

Status codes and error messages are displayed incorrectly on the angular client. #1126

@Quttar

Description

@Quttar

I am using the following code to get the result of executing a unary grpc request from a client.

client.login(req, (error, response) => {
      if (response != null) {
        this.tokenService.saveToken(response.getAccesstoken());
      }
      else{
        alert("Error code: " + error?.code + "Message: " + error?.message);
      }
    });

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions