@@ -53,8 +53,6 @@ pub(super) enum Kind {
5353 /// Error while writing a body to connection.
5454 #[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
5555 BodyWrite ,
56- /// The body write was aborted.
57- BodyWriteAborted ,
5856 /// Error calling AsyncWrite::shutdown()
5957 #[ cfg( feature = "http1" ) ]
6058 Shutdown ,
@@ -96,6 +94,8 @@ pub(super) enum User {
9694 /// Error calling user's HttpBody::poll_data().
9795 #[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
9896 Body ,
97+ /// The user aborted writing of the outgoing body.
98+ BodyWriteAborted ,
9999 /// Error calling user's MakeService.
100100 #[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
101101 #[ cfg( feature = "server" ) ]
@@ -193,7 +193,7 @@ impl Error {
193193
194194 /// Returns true if the body write was aborted.
195195 pub fn is_body_write_aborted ( & self ) -> bool {
196- matches ! ( self . inner. kind, Kind :: BodyWriteAborted )
196+ matches ! ( self . inner. kind, Kind :: User ( User :: BodyWriteAborted ) )
197197 }
198198
199199 /// Returns true if the error was caused by a timeout.
@@ -305,7 +305,7 @@ impl Error {
305305 }
306306
307307 pub ( super ) fn new_body_write_aborted ( ) -> Error {
308- Error :: new ( Kind :: BodyWriteAborted )
308+ Error :: new ( Kind :: User ( User :: BodyWriteAborted ) )
309309 }
310310
311311 fn new_user ( user : User ) -> Error {
@@ -444,7 +444,6 @@ impl Error {
444444 Kind :: Body => "error reading a body from connection" ,
445445 #[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
446446 Kind :: BodyWrite => "error writing a body to connection" ,
447- Kind :: BodyWriteAborted => "body write aborted" ,
448447 #[ cfg( feature = "http1" ) ]
449448 Kind :: Shutdown => "error shutting down connection" ,
450449 #[ cfg( feature = "http2" ) ]
@@ -454,6 +453,7 @@ impl Error {
454453
455454 #[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
456455 Kind :: User ( User :: Body ) => "error from user's HttpBody stream" ,
456+ Kind :: User ( User :: BodyWriteAborted ) => "user body write aborted" ,
457457 #[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
458458 #[ cfg( feature = "server" ) ]
459459 Kind :: User ( User :: MakeService ) => "error from user's MakeService" ,
0 commit comments