@@ -92,7 +92,7 @@ def get_object(cls, concerned_object: projects.Project, branch_name: str) -> Bra
9292 except (HTTPError , ConnectionError , RequestException ) as e :
9393 if isinstance (HTTPError , e ) and e .response .status_code == HTTPStatus .NOT_FOUND :
9494 raise exceptions .ObjectNotFound (concerned_object .key , f"Project '{ concerned_object .key } ' not found" )
95- log .critical ("%s while getting branch '%s' of %s" , util .http_error (e ), branch_name , str (concerned_object ))
95+ log .critical ("%s while getting branch '%s' of %s" , util .error_msg (e ), branch_name , str (concerned_object ))
9696 raise
9797 for br in data .get ("branches" , []):
9898 if br ["name" ] == branch_name :
@@ -132,7 +132,7 @@ def refresh(self) -> Branch:
132132 except (HTTPError , ConnectionError , RequestException ) as e :
133133 if isinstance (HTTPError , e ) and e .response .status_code == HTTPStatus .NOT_FOUND :
134134 raise exceptions .ObjectNotFound (self .key , f"{ str (self )} not found in SonarQube" )
135- log .error ("%s while refreshing %s" , util .http_error (e ), str (self ))
135+ log .error ("%s while refreshing %s" , util .error_msg (e ), str (self ))
136136 for br in data .get ("branches" , []):
137137 if br ["name" ] == self .name :
138138 self ._load (br )
@@ -189,7 +189,7 @@ def delete(self) -> bool:
189189 if isinstance (e , HTTPError ) and e .response .status_code == HTTPStatus .BAD_REQUEST :
190190 log .warning ("Can't delete %s, it's the main branch" , str (self ))
191191 else :
192- log .error ("%s while deleting %s" , util .http_error (e ), str (self ))
192+ log .error ("%s while deleting %s" , util .error_msg (e ), str (self ))
193193 return False
194194
195195 def new_code (self ) -> str :
@@ -205,7 +205,7 @@ def new_code(self) -> str:
205205 except (HTTPError , ConnectionError , RequestException ) as e :
206206 if isinstance (e , HTTPError ) and e .response .status_code == HTTPStatus .NOT_FOUND :
207207 raise exceptions .ObjectNotFound (self .concerned_object .key , f"{ str (self .concerned_object )} not found" )
208- log .error ("%s while getting new code period of %s" , util .http_error (e ), str (self ))
208+ log .error ("%s while getting new code period of %s" , util .error_msg (e ), str (self ))
209209 raise e
210210 for b in data ["newCodePeriods" ]:
211211 new_code = settings .new_code_to_string (b )
@@ -268,7 +268,7 @@ def rename(self, new_name):
268268 except (HTTPError , ConnectionError , RequestException ) as e :
269269 if isinstance (HTTPError , e ) and e .response .status_code == HTTPStatus .NOT_FOUND :
270270 raise exceptions .ObjectNotFound (self .concerned_object .key , f"str{ self .concerned_object } not found" )
271- log .error ("%s while renaming %s" , util .http_error (e ), str (self ))
271+ log .error ("%s while renaming %s" , util .error_msg (e ), str (self ))
272272 raise
273273 _OBJECTS .pop (self .uuid (), None )
274274 self .name = new_name
@@ -365,7 +365,7 @@ def audit(self, audit_settings: types.ConfigSettings) -> list[Problem]:
365365 try :
366366 return self .__audit_last_analysis (audit_settings ) + self .__audit_zero_loc () + self .__audit_never_analyzed ()
367367 except (HTTPError , RequestException , Exception ) as e :
368- log .error ("%s while auditing %s, audit skipped" , util .http_error (e ), str (self ))
368+ log .error ("%s while auditing %s, audit skipped" , util .error_msg (e ), str (self ))
369369 else :
370370 log .debug ("Branch audit disabled, skipping audit of %s" , str (self ))
371371 return []
0 commit comments