fix difference between unitary and stream codec error handling
diff --git a/rpc_util.go b/rpc_util.go
index 21a4a15..7410c50 100644
--- a/rpc_util.go
+++ b/rpc_util.go
@@ -187,8 +187,11 @@
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.")
}