@@ -61,6 +61,9 @@ pub enum ConnectError {
61
61
NoLocalAddr ,
62
62
#[ error( "tls connection failed" ) ]
63
63
Tls ( #[ source] std:: io:: Error ) ,
64
+ #[ cfg( wasm_browser) ]
65
+ #[ error( "The relay protocol is not available in browsers" ) ]
66
+ RelayProtoNotAvailable ,
64
67
}
65
68
66
69
/// Dialing errors
@@ -90,35 +93,6 @@ pub enum DialError {
90
93
ProxyInvalidTargetPort ,
91
94
}
92
95
93
- /// Client related errors
94
- #[ allow( missing_docs) ]
95
- #[ derive( Debug , thiserror:: Error ) ]
96
- #[ non_exhaustive]
97
- pub enum Error {
98
- #[ cfg( not( wasm_browser) ) ]
99
- #[ error( transparent) ]
100
- Dns ( #[ from] DnsError ) ,
101
- #[ error( transparent) ]
102
- Hyper ( #[ from] hyper:: Error ) ,
103
- #[ error( transparent) ]
104
- InvalidDnsName ( #[ from] rustls:: pki_types:: InvalidDnsNameError ) ,
105
- #[ error( transparent) ]
106
- ProtoRelay ( #[ from] crate :: protos:: relay:: Error ) ,
107
- #[ error( transparent) ]
108
- Io ( #[ from] std:: io:: Error ) ,
109
- #[ error( "Timeout" ) ]
110
- Timeout ( #[ from] time:: Elapsed ) ,
111
- #[ error( transparent) ]
112
- Http ( #[ from] hyper:: http:: Error ) ,
113
- #[ error( transparent) ]
114
- Utf8 ( #[ from] std:: str:: Utf8Error ) ,
115
- #[ cfg( wasm_browser) ]
116
- #[ error( "The relay protocol is not available in browsers" ) ]
117
- RelayProtoNotAvailable ,
118
- #[ error( transparent) ]
119
- Websocket ( #[ from] tokio_tungstenite_wasm:: Error ) ,
120
- }
121
-
122
96
/// Build a Client.
123
97
#[ derive( derive_more:: Debug , Clone ) ]
124
98
pub struct ClientBuilder {
@@ -233,7 +207,7 @@ impl ClientBuilder {
233
207
( conn, Some ( local_addr) )
234
208
}
235
209
#[ cfg( wasm_browser) ]
236
- Protocol :: Relay => return Err ( Error :: RelayProtoNotAvailable ) ,
210
+ Protocol :: Relay => return Err ( ConnectError :: RelayProtoNotAvailable ) ,
237
211
} ;
238
212
239
213
event ! (
0 commit comments