feat(error): add Ssl variant to hyper::Error
The errors from openssl were previously boxed into a Box<std::error::Error>, which lost some specifics and made it difficult to match against. To solve this, an `Ssl` variant is added to the `Error` enum of hyper, and is returned when openssl returns specific errors. Closes #483 BREAKING CHANGE: Adds a variant to `hyper::Error`, which may break any exhaustive matches.
This commit is contained in:
@@ -144,7 +144,7 @@ impl<C: NetworkConnector<Stream=S> + Send, S: NetworkStream + Send> NetworkConne
|
||||
type Stream = Box<NetworkStream + Send>;
|
||||
#[inline]
|
||||
fn connect(&mut self, host: &str, port: u16, scheme: &str)
|
||||
-> io::Result<Box<NetworkStream + Send>> {
|
||||
-> ::Result<Box<NetworkStream + Send>> {
|
||||
Ok(try!(self.0.connect(host, port, scheme)).into())
|
||||
}
|
||||
}
|
||||
@@ -155,7 +155,7 @@ impl NetworkConnector for Connector {
|
||||
type Stream = Box<NetworkStream + Send>;
|
||||
#[inline]
|
||||
fn connect(&mut self, host: &str, port: u16, scheme: &str)
|
||||
-> io::Result<Box<NetworkStream + Send>> {
|
||||
-> ::Result<Box<NetworkStream + Send>> {
|
||||
Ok(try!(self.0.connect(host, port, scheme)).into())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ impl<S> PoolImpl<S> {
|
||||
|
||||
impl<C: NetworkConnector<Stream=S>, S: NetworkStream + Send> NetworkConnector for Pool<C> {
|
||||
type Stream = PooledStream<S>;
|
||||
fn connect(&mut self, host: &str, port: u16, scheme: &str) -> io::Result<PooledStream<S>> {
|
||||
fn connect(&mut self, host: &str, port: u16, scheme: &str) -> ::Result<PooledStream<S>> {
|
||||
let key = key(host, port, scheme);
|
||||
let mut locked = self.inner.lock().unwrap();
|
||||
let mut should_remove = false;
|
||||
|
||||
Reference in New Issue
Block a user