From 594f4bf1338811f50da7b33268e424bff3109ba3 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rpc_util.go b/rpc_util.go index 21a4a15a..7410c50b 100644 --- a/rpc_util.go +++ b/rpc_util.go @@ -187,8 +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.") }