Convert io.ErrUnexpectedEOF to a codes.Internal-marked status in toRPCerr. (#2228)
This is consistent with how io.ErrUnexpectedEOF is handled in a bunch of other places (e.g. stream.go, server.go), and signals to application-level code that the error is retryable.
This commit is contained in:
@ -179,6 +179,7 @@ func TestToRPCErr(t *testing.T) {
|
||||
}{
|
||||
{transport.StreamError{Code: codes.Unknown, Desc: ""}, status.Error(codes.Unknown, "")},
|
||||
{transport.ErrConnClosing, status.Error(codes.Unavailable, transport.ErrConnClosing.Desc)},
|
||||
{io.ErrUnexpectedEOF, status.Error(codes.Internal, io.ErrUnexpectedEOF.Error())},
|
||||
} {
|
||||
err := toRPCErr(test.errIn)
|
||||
if _, ok := status.FromError(err); !ok {
|
||||
|
Reference in New Issue
Block a user