File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 1+ use std:: error:: Error as StdError ;
12use std:: fmt;
23
34use super :: {
@@ -164,9 +165,19 @@ impl MatchValidator for AwsValidator {
164165 match res {
165166 Ok ( val) => handle_reqwest_response ( match_status, & val) ,
166167 Err ( err) => {
167- * match_status = MatchStatus :: Error ( fmt:: format ( format_args ! (
168- "Error making HTTP request: {err}"
169- ) ) ) ;
168+ let mut msg = format ! ( "Error making HTTP request: {err}" ) ;
169+ if err. is_timeout ( ) {
170+ msg. push_str ( ": timeout" ) ;
171+ } else if err. is_connect ( ) {
172+ msg. push_str ( ": connect error" ) ;
173+ }
174+ if let Some ( status) = err. status ( ) {
175+ msg. push_str ( format ! ( ": status {}" , status. as_u16( ) ) . as_str ( ) ) ;
176+ }
177+ if let Some ( source) = StdError :: source ( & err) {
178+ msg. push_str ( format ! ( ": {}" , source) . as_str ( ) ) ;
179+ }
180+ * match_status = MatchStatus :: Error ( msg) ;
170181 }
171182 } ;
172183 } ) ;
You can’t perform that action at this time.
0 commit comments