fix(lib): return an error instead of panic if execute fails
If executing an internal task fails, a new variant of `hyper::Error` is returned to the user, with improved messaging. If a non-critical task fails to spawn, it no longer panics, instead just logging a warning. Closes #1566
This commit is contained in:
		| @@ -94,7 +94,7 @@ where | ||||
|                             } | ||||
|                             Err(Either::B((never, _))) => match never {}, | ||||
|                         }); | ||||
|                     self.executor.execute(fut); | ||||
|                     self.executor.execute(fut)?; | ||||
|                     State::Ready(request_tx, tx) | ||||
|                 }, | ||||
|                 State::Ready(ref mut tx, ref conn_dropper) => { | ||||
| @@ -129,7 +129,7 @@ where | ||||
|                                         drop(conn_drop_ref); | ||||
|                                         x | ||||
|                                     }); | ||||
|                                 self.executor.execute(pipe); | ||||
|                                 self.executor.execute(pipe)?; | ||||
|                             } | ||||
|  | ||||
|                             let fut = fut | ||||
| @@ -148,7 +148,7 @@ where | ||||
|                                     } | ||||
|                                     Ok(()) | ||||
|                                 }); | ||||
|                             self.executor.execute(fut); | ||||
|                             self.executor.execute(fut)?; | ||||
|                             continue; | ||||
|                         }, | ||||
|  | ||||
|   | ||||
| @@ -132,7 +132,7 @@ where | ||||
|                 ::Body::h2(stream, content_length) | ||||
|             }); | ||||
|             let fut = H2Stream::new(service.call(req), respond); | ||||
|             exec.execute(fut); | ||||
|             exec.execute(fut)?; | ||||
|         } | ||||
|  | ||||
|         // no more incoming streams... | ||||
|   | ||||
		Reference in New Issue
	
	Block a user