Skip to content

Commit

Permalink
Merge pull request #384 from mwitkow-io/bugfix/fix_stream_codec_error…
Browse files Browse the repository at this point in the history
…s_take2

fix difference between unitary and stream codec error handling
  • Loading branch information
iamqizhao committed Oct 6, 2015
2 parents c2ad501 + 1a7cf7f commit 4673c7d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rpc_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down

0 comments on commit 4673c7d

Please sign in to comment.