Merge pull request #868 from menghanl/connection_errorf

Use ConnectionErrorf
This commit is contained in:
Qi Zhao
2016-08-26 15:36:31 -07:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@ -393,5 +393,5 @@ func mapRecvMsgError(err error) error {
} }
} }
} }
return ConnectionError{Desc: err.Error()} return ConnectionErrorf(true, err, err.Error())
} }

View File

@ -522,7 +522,7 @@ func (e ConnectionError) Origin() error {
var ( var (
// ErrConnClosing indicates that the transport is closing. // ErrConnClosing indicates that the transport is closing.
ErrConnClosing = ConnectionError{Desc: "transport is closing", temp: true} ErrConnClosing = ConnectionErrorf(true, nil, "transport is closing")
// ErrStreamDrain indicates that the stream is rejected by the server because // ErrStreamDrain indicates that the stream is rejected by the server because
// the server stops accepting new RPCs. // the server stops accepting new RPCs.
ErrStreamDrain = StreamErrorf(codes.Unavailable, "the server stops accepting new RPCs") ErrStreamDrain = StreamErrorf(codes.Unavailable, "the server stops accepting new RPCs")