Merge pull request #384 from mwitkow-io/bugfix/fix_stream_codec_errors_take2

fix difference between unitary and stream codec error handling
This commit is contained in:
Qi Zhao 2015-10-06 15:58:37 -07:00
commit 4673c7de99
1 changed files with 5 additions and 1 deletions

View File

@ -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.")