File tree Expand file tree Collapse file tree 2 files changed +5
-18
lines changed
wp_rs_cli/src/bin/wp_rs_cli Expand file tree Collapse file tree 2 files changed +5
-18
lines changed Original file line number Diff line number Diff line change @@ -187,35 +187,22 @@ impl From<reqwest::Error> for RequestExecutionError {
187187
188188 if let Some ( io_error) = error. as_io_error ( ) {
189189 match io_error. kind ( ) {
190- std:: io:: ErrorKind :: ConnectionRefused => {
191- return RequestExecutionError :: RequestExecutionFailed {
192- status_code,
193- redirects : None ,
194- reason : RequestExecutionErrorReason :: NonExistentSiteError {
195- error_message : Some ( "Connection refused" . to_string ( ) ) ,
196- suggested_action : None ,
197- } ,
198- } ;
199- }
200190 std:: io:: ErrorKind :: UnexpectedEof => {
201191 // Server terminated the connection unexpectedly
202192 return RequestExecutionError :: RequestExecutionFailed {
203193 status_code,
204194 redirects : None ,
205- reason : RequestExecutionErrorReason :: NonExistentSiteError {
206- error_message : Some (
207- "The server terminated the connection unexpectedly" . to_string ( ) ,
208- ) ,
209- suggested_action : None ,
195+ reason : RequestExecutionErrorReason :: HttpError {
196+ reason : "The server terminated the connection unexpectedly" . to_string ( ) ,
210197 } ,
211198 } ;
212199 }
213200 _ => {
214201 return RequestExecutionError :: RequestExecutionFailed {
215202 status_code,
216203 redirects : None ,
217- reason : RequestExecutionErrorReason :: GenericError {
218- error_message : error . to_string ( ) ,
204+ reason : RequestExecutionErrorReason :: HttpError {
205+ reason : io_error . to_string ( ) ,
219206 } ,
220207 } ;
221208 }
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ impl SimplifiedDiscoveryResult {
182182 println ! ( "{}" , format!( "Login URL found: {login_url}" ) . green( ) ) ;
183183 }
184184 Err ( error) => {
185- println ! ( "{}" , format! ( "Error: {}" , error) . red( ) ) ;
185+ println ! ( "{}" , error. to_string ( ) . red( ) ) ;
186186 }
187187 }
188188 }
You can’t perform that action at this time.
0 commit comments