@@ -41,6 +41,35 @@ pub enum AcceptConnection {
4141 ServerEndpointClosed ,
4242}
4343
44+ pub ( in crate :: net) mod configure_client {
45+ use thiserror:: Error ;
46+
47+ #[ derive( Debug , Error ) ]
48+ pub ( in crate :: net) enum Inner {
49+ #[ error( transparent) ]
50+ NoInitialCipherSuite (
51+ #[ from] quinn:: crypto:: rustls:: NoInitialCipherSuite ,
52+ ) ,
53+ #[ error( "rustls error" ) ]
54+ Rustls ( #[ source] rustls:: Error ) ,
55+ }
56+
57+ #[ derive( Debug , Error ) ]
58+ #[ error( "failed to configure p2p client" ) ]
59+ #[ repr( transparent) ]
60+ pub struct Error ( #[ source] Inner ) ;
61+
62+ impl < E > From < E > for Error
63+ where
64+ Inner : From < E > ,
65+ {
66+ fn from ( err : E ) -> Self {
67+ Self ( err. into ( ) )
68+ }
69+ }
70+ }
71+ pub use configure_client:: Error as ConfigureClient ;
72+
4473#[ allow( clippy:: duplicated_attributes) ]
4574#[ derive( Debug , Error , Transitive ) ]
4675#[ transitive( from( db:: error:: Put , db:: Error ) ) ]
@@ -58,6 +87,8 @@ pub enum Error {
5887 AlreadyConnected ( #[ from] AlreadyConnected ) ,
5988 #[ error( "bincode error" ) ]
6089 Bincode ( #[ from] bincode:: Error ) ,
90+ #[ error( transparent) ]
91+ ConfigureClient ( #[ from] ConfigureClient ) ,
6192 #[ error( "connect error" ) ]
6293 Connect ( #[ from] quinn:: ConnectError ) ,
6394 #[ error( transparent) ]
@@ -74,8 +105,6 @@ pub enum Error {
74105 /// `0.0.0.0` is one example of an "unspecified" IP.
75106 #[ error( "unspecified peer ip address (cannot connect to '{0}')" ) ]
76107 UnspecfiedPeerIP ( IpAddr ) ,
77- #[ error( transparent) ]
78- NoInitialCipherSuite ( #[ from] quinn:: crypto:: rustls:: NoInitialCipherSuite ) ,
79108 #[ error( "peer connection" ) ]
80109 PeerConnection ( #[ source] Box < PeerConnectionError > ) ,
81110 #[ error( "quinn rustls error" ) ]
0 commit comments