fix difference between unitary and stream codec error handling
This commit is contained in:
@ -187,8 +187,12 @@ func recv(p *parser, c Codec, m interface{}) error {
|
|||||||
switch pf {
|
switch pf {
|
||||||
case compressionNone:
|
case compressionNone:
|
||||||
if err := c.Unmarshal(d, m); err != nil {
|
if err := c.Unmarshal(d, m); err != nil {
|
||||||
|
if rErr, ok := err.(rpcError); ok {
|
||||||
|
return rErr
|
||||||
|
} else {
|
||||||
return Errorf(codes.Internal, "grpc: %v", err)
|
return Errorf(codes.Internal, "grpc: %v", err)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return Errorf(codes.Internal, "gprc: compression is not supported yet.")
|
return Errorf(codes.Internal, "gprc: compression is not supported yet.")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user