sourceforge: Catch correct ConnectionError exception

This commit is contained in:
Antoine Lambert 2024-11-07 14:25:29 +01:00
parent a8871bd492
commit 63ca5b50a0

View file

@ -336,7 +336,7 @@ class SourceForgeLister(Lister[SourceForgeListerState, SourceForgeListerPage]):
try:
res = self.http_request(endpoint).json()
except (requests.HTTPError, ConnectionError):
except (requests.HTTPError, requests.exceptions.ConnectionError):
# We've already logged in `http_request`
return []
@ -358,7 +358,7 @@ class SourceForgeLister(Lister[SourceForgeListerState, SourceForgeListerPage]):
cvs_info_url = f"http://{project}.cvs.sourceforge.net"
try:
response = self.http_request(cvs_info_url)
except (requests.HTTPError, ConnectionError):
except (requests.HTTPError, requests.exceptions.ConnectionError):
logger.warning(
"CVS info page could not be fetched, skipping project '%s'",
project,
@ -420,7 +420,7 @@ class SourceForgeLister(Lister[SourceForgeListerState, SourceForgeListerPage]):
)
)
continue
except (requests.HTTPError, ConnectionError):
except (requests.HTTPError, requests.exceptions.ConnectionError):
logger.warning(
"Bazaar repository page could not be fetched, skipping project '%s'",
project,