Skip to content

Commit

Permalink
return a proper grpc error when lookup fails
Browse files Browse the repository at this point in the history
  • Loading branch information
andyroyle committed Nov 30, 2018
1 parent 4caac25 commit bf09fda
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion proxy/grpc_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/fabiolb/fabio/route"
grpc_proxy "github.com/mwitkow/grpc-proxy/proxy"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/connectivity"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/metadata"
Expand Down Expand Up @@ -92,7 +93,8 @@ func (g GrpcProxyInterceptor) Stream(srv interface{}, stream grpc.ServerStream,
target, err := g.lookup(ctx, info.FullMethod)

if err != nil {
return err
log.Println("[WARN] grpc: error looking up route ", err)
return status.Errorf(codes.Internal, "internal error")
}

ctx = context.WithValue(ctx, targetKey{}, target)
Expand Down

0 comments on commit bf09fda

Please sign in to comment.