File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,12 @@ impl Error {
120120 if err. is :: < TimedOut > ( ) {
121121 return true ;
122122 }
123+ #[ cfg( not( target_arch = "wasm32" ) ) ]
124+ if let Some ( hyper_err) = err. downcast_ref :: < hyper:: Error > ( ) {
125+ if hyper_err. is_timeout ( ) {
126+ return true ;
127+ }
128+ }
123129 if let Some ( io) = err. downcast_ref :: < io:: Error > ( ) {
124130 if io. kind ( ) == io:: ErrorKind :: TimedOut {
125131 return true ;
@@ -453,7 +459,9 @@ mod tests {
453459 let err = super :: request ( super :: TimedOut ) ;
454460 assert ! ( err. is_timeout( ) ) ;
455461
456- let io = io:: Error :: new ( io:: ErrorKind :: Other , err) ;
462+ // todo: test `hyper::Error::is_timeout` when we can easily construct one
463+
464+ let io = io:: Error :: from ( io:: ErrorKind :: TimedOut ) ;
457465 let nested = super :: request ( io) ;
458466 assert ! ( nested. is_timeout( ) ) ;
459467 }
You can’t perform that action at this time.
0 commit comments