From 1a7cf7f6961d3e195422739d2c7fcc4164f270db Mon Sep 17 00:00:00 2001 From: Michal Witkowski Date: Thu, 1 Oct 2015 17:37:17 +0100 Subject: [PATCH] fix difference between unitary and stream codec error handling --- rpc_util.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rpc_util.go b/rpc_util.go index 21a4a15a7..a9bab996a 100644 --- a/rpc_util.go +++ b/rpc_util.go @@ -187,7 +187,11 @@ func recv(p *parser, c Codec, m interface{}) error { switch pf { case compressionNone: if err := c.Unmarshal(d, m); err != nil { - return Errorf(codes.Internal, "grpc: %v", err) + if rErr, ok := err.(rpcError); ok { + return rErr + } else { + return Errorf(codes.Internal, "grpc: %v", err) + } } default: return Errorf(codes.Internal, "gprc: compression is not supported yet.")