refactor(error): improve error message when tokio::spawn fails
Closes #1635
This commit is contained in:
		
							
								
								
									
										14
									
								
								src/error.rs
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								src/error.rs
									
									
									
									
									
								
							| @@ -258,8 +258,8 @@ impl Error { | ||||
|         Error::new(Kind::Shutdown, Some(Box::new(cause))) | ||||
|     } | ||||
|  | ||||
|     pub(crate) fn new_execute() -> Error { | ||||
|         Error::new(Kind::Execute, None) | ||||
|     pub(crate) fn new_execute<E: Into<Cause>>(cause: E) -> Error { | ||||
|         Error::new(Kind::Execute, Some(cause.into())) | ||||
|     } | ||||
|  | ||||
|     pub(crate) fn new_h2(cause: ::h2::Error) -> Error { | ||||
| @@ -269,10 +269,12 @@ impl Error { | ||||
|  | ||||
| impl fmt::Debug for Error { | ||||
|     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | ||||
|         f.debug_struct("Error") | ||||
|             .field("kind", &self.inner.kind) | ||||
|             .field("cause", &self.inner.cause) | ||||
|             .finish() | ||||
|         let mut f = f.debug_struct("Error"); | ||||
|         f.field("kind", &self.inner.kind); | ||||
|         if let Some(ref cause) = self.inner.cause { | ||||
|             f.field("cause", cause); | ||||
|         } | ||||
|         f.finish() | ||||
|     } | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user