@@ -47,6 +47,8 @@ pub(crate) enum Kind {
4747Body , 
4848    /// Error while writing a body to connection. 
4949BodyWrite , 
50+     /// The body write was aborted. 
51+ BodyWriteAborted , 
5052    /// Error calling AsyncWrite::shutdown() 
5153Shutdown , 
5254
@@ -133,6 +135,11 @@ impl Error {
133135        self . inner . kind  == Kind :: IncompleteMessage 
134136    } 
135137
138+     /// Returns true if the body write was aborted. 
139+ pub  fn  is_body_write_aborted ( & self )  -> bool  { 
140+         self . inner . kind  == Kind :: BodyWriteAborted 
141+     } 
142+ 
136143    #[ doc( hidden) ]  
137144    #[ cfg_attr( error_source,  deprecated( note = "use Error::source instead" ) ) ]  
138145    pub  fn  cause2 ( & self )  -> Option < & ( dyn  StdError  + ' static  + Sync  + Send ) >  { 
@@ -250,6 +257,10 @@ impl Error {
250257        Error :: new ( Kind :: BodyWrite ) . with ( cause) 
251258    } 
252259
260+     pub ( crate )  fn  new_body_write_aborted ( )  -> Error  { 
261+         Error :: new ( Kind :: BodyWriteAborted ) 
262+     } 
263+ 
253264    fn  new_user ( user :  User )  -> Error  { 
254265        Error :: new ( Kind :: User ( user) ) 
255266    } 
@@ -352,6 +363,7 @@ impl StdError for Error {
352363            Kind :: Accept  => "error accepting connection" , 
353364            Kind :: Body  => "error reading a body from connection" , 
354365            Kind :: BodyWrite  => "error writing a body to connection" , 
366+             Kind :: BodyWriteAborted  => "body write aborted" , 
355367            Kind :: Shutdown  => "error shutting down connection" , 
356368            Kind :: Http2  => "http2 error" , 
357369            Kind :: Io  => "connection error" , 
0 commit comments