mirror of https://github.com/grpc/grpc-go.git
transport: return ErrConnClosing for proper handling (#2644)
transport: return ErrConnClosing for proper handling
This commit is contained in:
parent
3aaef9f0c1
commit
a51d23e017
|
@ -849,6 +849,9 @@ func (t *http2Server) WriteStatus(s *Stream, st *status.Status) error {
|
|||
func (t *http2Server) Write(s *Stream, hdr []byte, data []byte, opts *Options) error {
|
||||
if !s.isHeaderSent() { // Headers haven't been written yet.
|
||||
if err := t.WriteHeader(s, nil); err != nil {
|
||||
if _, ok := err.(ConnectionError); ok {
|
||||
return err
|
||||
}
|
||||
// TODO(mmukhi, dfawley): Make sure this is the right code to return.
|
||||
return status.Errorf(codes.Internal, "transport: %v", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue