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

interop: go client silently discards service errors #182

Closed
gainward opened this issue Apr 30, 2015 · 1 comment
Closed

interop: go client silently discards service errors #182

gainward opened this issue Apr 30, 2015 · 1 comment

Comments

@gainward
Copy link

Observed when calling against a service built on the C++ gRPC core.

// Service snippet

class GreeterServiceImpl final : public Greeter::Service {
  Status SayHello(ServerContext* context, const HelloRequest* request,
                  HelloReply* reply) override {
    return Status(grpc::StatusCode::NOT_FOUND);
  }
};

// Client snippet

package main
import (
    "log"
    "os"
    pb "github.com/grpc/grpc-common/go/helloworld"
    "golang.org/x/net/context"
    "google.golang.org/grpc"
)
const (
    address     = "localhost:50051"
    defaultName = "world"
)
func main() {
    // Set up a connection to the server.
    conn, err := grpc.Dial(address)
    if err != nil {
        log.Fatalf("did not connect: %v", err)
    }
    defer conn.Close()
    c := pb.NewGreeterClient(conn)
    // Contact the server and print out its response.
    name := defaultName
    if len(os.Args) > 1 {
        name = os.Args[1]
    }
    r, err := c.SayHello(context.Background(), &pb.HelloRequest{Name: name})
    if err != nil {
        log.Fatalf("could not greet: %v", err)
    }
    log.Printf("Greeting: %s", r.Message)
}

Client output:

$ go run greeter_client/*
2015/04/29 18:22:26 Greeting: 
@iamqizhao
Copy link
Contributor

This is due to a bug on C side and will be fixed by the pr 1426. I created an issue in grpc/grpc and am closing this one.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants