Redesign Error type
				
					
				
			- The `Error`'s kind is a now a set of variants depending on the context of when an error could occur. - If another error was the cause, it is now always the `source`. Along with the `is_*` methods, this should help in understanding *when* a certain error occurred. For example, an error setting the TLS certificates will return a builder error, with the TLS error as the source. This should help differentiate from a TLS error that happens when connecting to a server. It also makes the internal code less dependent on all the exact dependencies that can be enabled or disabled.
This commit is contained in:
		| @@ -258,9 +258,8 @@ async fn send_future(sender: Sender) -> Result<(), crate::Error> { | ||||
|                     buf.advance_mut(n); | ||||
|                 }, | ||||
|                 Err(e) => { | ||||
|                     let ret = io::Error::new(e.kind(), e.to_string()); | ||||
|                     tx.take().expect("tx only taken on error").abort(); | ||||
|                     return Err(crate::error::from(ret)); | ||||
|                     return Err(crate::error::body(e)); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
| @@ -273,7 +272,7 @@ async fn send_future(sender: Sender) -> Result<(), crate::Error> { | ||||
|             .expect("tx only taken on error") | ||||
|             .send_data(buf.take().freeze().into()) | ||||
|             .await | ||||
|             .map_err(crate::error::from)?; | ||||
|             .map_err(crate::error::body)?; | ||||
|  | ||||
|         written += buf_len; | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user