@@ -53,8 +53,6 @@ pub(super) enum Kind {
53
53
/// Error while writing a body to connection.
54
54
#[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
55
55
BodyWrite ,
56
- /// The body write was aborted.
57
- BodyWriteAborted ,
58
56
/// Error calling AsyncWrite::shutdown()
59
57
#[ cfg( feature = "http1" ) ]
60
58
Shutdown ,
@@ -96,6 +94,8 @@ pub(super) enum User {
96
94
/// Error calling user's HttpBody::poll_data().
97
95
#[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
98
96
Body ,
97
+ /// The user aborted writing of the outgoing body.
98
+ BodyWriteAborted ,
99
99
/// Error calling user's MakeService.
100
100
#[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
101
101
#[ cfg( feature = "server" ) ]
@@ -193,7 +193,7 @@ impl Error {
193
193
194
194
/// Returns true if the body write was aborted.
195
195
pub fn is_body_write_aborted ( & self ) -> bool {
196
- matches ! ( self . inner. kind, Kind :: BodyWriteAborted )
196
+ matches ! ( self . inner. kind, Kind :: User ( User :: BodyWriteAborted ) )
197
197
}
198
198
199
199
/// Returns true if the error was caused by a timeout.
@@ -305,7 +305,7 @@ impl Error {
305
305
}
306
306
307
307
pub ( super ) fn new_body_write_aborted ( ) -> Error {
308
- Error :: new ( Kind :: BodyWriteAborted )
308
+ Error :: new ( Kind :: User ( User :: BodyWriteAborted ) )
309
309
}
310
310
311
311
fn new_user ( user : User ) -> Error {
@@ -444,7 +444,6 @@ impl Error {
444
444
Kind :: Body => "error reading a body from connection" ,
445
445
#[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
446
446
Kind :: BodyWrite => "error writing a body to connection" ,
447
- Kind :: BodyWriteAborted => "body write aborted" ,
448
447
#[ cfg( feature = "http1" ) ]
449
448
Kind :: Shutdown => "error shutting down connection" ,
450
449
#[ cfg( feature = "http2" ) ]
@@ -454,6 +453,7 @@ impl Error {
454
453
455
454
#[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
456
455
Kind :: User ( User :: Body ) => "error from user's HttpBody stream" ,
456
+ Kind :: User ( User :: BodyWriteAborted ) => "user body write aborted" ,
457
457
#[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
458
458
#[ cfg( feature = "server" ) ]
459
459
Kind :: User ( User :: MakeService ) => "error from user's MakeService" ,
0 commit comments