@@ -10,6 +10,7 @@ pub enum TlsError {
1010 Rustls ( super :: rustls:: RustlsError ) ,
1111 #[ cfg( feature = "native-tls" ) ]
1212 NativeTls ( super :: native_tls:: NativeTlsError ) ,
13+ OtherTls ( Box < dyn error:: Error + Send + Sync > ) ,
1314}
1415
1516impl fmt:: Debug for TlsError {
@@ -22,6 +23,7 @@ impl fmt::Debug for TlsError {
2223 Self :: Rustls ( ref e) => fmt:: Debug :: fmt ( e, _f) ,
2324 #[ cfg( feature = "native-tls" ) ]
2425 Self :: NativeTls ( ref e) => fmt:: Debug :: fmt ( e, _f) ,
26+ Self :: OtherTls ( ref e) => fmt:: Debug :: fmt ( e, _f) ,
2527 }
2628 }
2729}
@@ -36,12 +38,19 @@ impl fmt::Display for TlsError {
3638 Self :: Rustls ( ref e) => fmt:: Debug :: fmt ( e, _f) ,
3739 #[ cfg( feature = "native-tls" ) ]
3840 Self :: NativeTls ( ref e) => fmt:: Display :: fmt ( e, _f) ,
41+ Self :: OtherTls ( ref e) => fmt:: Display :: fmt ( e, _f) ,
3942 }
4043 }
4144}
4245
4346impl error:: Error for TlsError { }
4447
48+ impl From < Box < dyn error:: Error + Send + Sync > > for TlsError {
49+ fn from ( e : Box < dyn error:: Error + Send + Sync > ) -> Self {
50+ Self :: OtherTls ( e)
51+ }
52+ }
53+
4554impl < S , B > From < TlsError > for HttpServiceError < S , B > {
4655 fn from ( e : TlsError ) -> Self {
4756 Self :: Tls ( e)
0 commit comments