@@ -89,7 +89,7 @@ def get_object(cls, concerned_object: projects.Project, branch_name: str) -> Bra
8989 return _OBJECTS [uu ]
9090 try :
9191 data = json .loads (concerned_object .endpoint .get (APIS ["list" ], params = {"project" : concerned_object .key }).text )
92- except (HTTPError , ConnectionError , RequestException ) as e :
92+ except (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" )
9595 log .critical ("%s while getting branch '%s' of %s" , util .error_msg (e ), branch_name , str (concerned_object ))
@@ -129,7 +129,7 @@ def refresh(self) -> Branch:
129129 """
130130 try :
131131 data = json .loads (self .get (APIS ["list" ], params = {"project" : self .concerned_object .key }).text )
132- except (HTTPError , ConnectionError , RequestException ) as e :
132+ except (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" )
135135 log .error ("%s while refreshing %s" , util .error_msg (e ), str (self ))
@@ -185,7 +185,7 @@ def delete(self) -> bool:
185185 """
186186 try :
187187 return sq .delete_object (self , APIS ["delete" ], {"branch" : self .name , "project" : self .concerned_object .key }, _OBJECTS )
188- except (HTTPError , ConnectionError , RequestException ) as e :
188+ except (ConnectionError , RequestException ) as e :
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 :
@@ -202,7 +202,7 @@ def new_code(self) -> str:
202202 elif self ._new_code is None :
203203 try :
204204 data = json .loads (self .get (api = APIS ["get_new_code" ], params = {"project" : self .concerned_object .key }).text )
205- except (HTTPError , ConnectionError , RequestException ) as e :
205+ except (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" )
208208 log .error ("%s while getting new code period of %s" , util .error_msg (e ), str (self ))
@@ -265,7 +265,7 @@ def rename(self, new_name):
265265 log .info ("Renaming main branch of %s from '%s' to '%s'" , str (self .concerned_object ), self .name , new_name )
266266 try :
267267 self .post (APIS ["rename" ], params = {"project" : self .concerned_object .key , "name" : new_name })
268- except (HTTPError , ConnectionError , RequestException ) as e :
268+ except (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" )
271271 log .error ("%s while renaming %s" , util .error_msg (e ), str (self ))
0 commit comments