File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,10 +109,9 @@ where
109109 "Attempting to connect to EthStats server at {}" , self . credentials. host
110110 ) ;
111111 let full_url = format ! ( "ws://{}/api" , self . credentials. host) ;
112- let url = Url :: parse ( & full_url)
113- . map_err ( |e| EthStatsError :: InvalidUrl ( format ! ( "Invalid URL: {full_url} - {e}" ) ) ) ?;
112+ let url = Url :: parse ( & full_url) . map_err ( EthStatsError :: Url ) ?;
114113
115- match timeout ( CONNECT_TIMEOUT , connect_async ( url. to_string ( ) ) ) . await {
114+ match timeout ( CONNECT_TIMEOUT , connect_async ( url. as_str ( ) ) ) . await {
116115 Ok ( Ok ( ( ws_stream, _) ) ) => {
117116 debug ! (
118117 target: "ethstats" ,
@@ -123,7 +122,7 @@ where
123122 self . login ( ) . await ?;
124123 Ok ( ( ) )
125124 }
126- Ok ( Err ( e) ) => Err ( EthStatsError :: InvalidUrl ( e . to_string ( ) ) ) ,
125+ Ok ( Err ( e) ) => Err ( EthStatsError :: WebSocket ( e ) ) ,
127126 Err ( _) => {
128127 debug ! ( target: "ethstats" , "Connection to EthStats server timed out" ) ;
129128 Err ( EthStatsError :: Timeout )
You can’t perform that action at this time.
0 commit comments