hyperium / hyper-tls

Apache License 2.0
189 stars 96 forks source link

native_tls::Error #9

Closed sb89 closed 6 years ago

sb89 commented 7 years ago

I'm trying to use error_chain with the following code:

let connector = HttpsConnector::new(4, handle)?;

Which gives me the following error:

the trait std::convert::From<native_tls::Error> is not implemented for errors::Error

So to be able to add native_tls::Error as a foreign_link in error_chain, I'll have to add native_tls as an additional dependency for my project? Should this error be exported by hyper-tls somehow?

kamyuentse commented 7 years ago

The native_tls::Error is dependent on tls implementation currently. Check https://docs.rs/native-tls/0.1.4/src/native_tls/lib.rs.html#134

It's not easy to make them conform, but just return the native_tls::Result<HttpsConnector> from hyper_tls::HttpsConnector::new() is a real eyesore. I think the error module should be redesigned.

niklasad1 commented 6 years ago

@seanmonstar I think you can close this now :smile: