11pub use ugh_privacy:: DbError ;
22
33use byteorder;
4- use openssl:: ssl:: error:: SslError ;
54use phf;
65use std:: error;
76use std:: convert:: From ;
@@ -29,8 +28,8 @@ pub enum ConnectError {
2928 UnsupportedAuthentication ,
3029 /// The Postgres server does not support SSL encryption.
3130 NoSslSupport ,
32- /// There was an error initializing the SSL session.
33- SslError ( SslError ) ,
31+ /// There was an error initializing the SSL session
32+ SslError ( Box < error :: Error > ) ,
3433 /// There was an error communicating with the server.
3534 IoError ( io:: Error ) ,
3635 /// The server sent an unexpected response.
@@ -67,7 +66,7 @@ impl error::Error for ConnectError {
6766 fn cause ( & self ) -> Option < & error:: Error > {
6867 match * self {
6968 ConnectError :: DbError ( ref err) => Some ( err) ,
70- ConnectError :: SslError ( ref err) => Some ( err) ,
69+ ConnectError :: SslError ( ref err) => Some ( & * * err) ,
7170 ConnectError :: IoError ( ref err) => Some ( err) ,
7271 _ => None
7372 }
@@ -86,12 +85,6 @@ impl From<DbError> for ConnectError {
8685 }
8786}
8887
89- impl From < SslError > for ConnectError {
90- fn from ( err : SslError ) -> ConnectError {
91- ConnectError :: SslError ( err)
92- }
93- }
94-
9588impl From < byteorder:: Error > for ConnectError {
9689 fn from ( err : byteorder:: Error ) -> ConnectError {
9790 ConnectError :: IoError ( From :: from ( err) )
0 commit comments