How to use the grpc-web.StatusCode function in grpc-web

To help you get started, we’ve selected a few grpc-web examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github johanbrandhorst / grpc-web-compatibility-test / frontend / grpcweb / src / index.ts View on Github external
srv.on("status", function(status: grpcWeb.Status) {
    if (status.code != grpcWeb.StatusCode.OK) {
      console.log("Got streaming error");
      console.log("Error:", status.details);
      console.log("Code:", status.code);
      console.log("Metadata:", status.metadata);
    }
  });
}
github grpc / grpc-web / net / grpc / gateway / examples / echo / ts-example / client.ts View on Github external
(err: grpcWeb.Error, response: EchoResponse) => {
          if (err) {
            if (err.code !== grpcWeb.StatusCode.OK) {
              EchoApp.addRightMessage(
                  'Error code: ' + err.code + ' "' + err.message + '"');
            }
          } else {
            setTimeout(() => {
              EchoApp.addRightMessage(response.getMessage());
            }, EchoApp.INTERVAL);
          }
        });
    call.on('status', (status: grpcWeb.Status) => {