sourceforge: Also skip ConnectionError when fetching project info

The sourceforge lister sends various HTTP requests to get info about a
project, for instance to get the branch name of a Bazaar project.

If HTTP errors occurred during these steps, they were discarded in order
for the listing to continue but connection errors were not and as a
consequence the listing was failing when encountering such error.

Currently, the legacy Bazaar project hosted on sourceforge seems down and
connection  errors are raised when attempting to fetch branch names so the
lister does not process all projects as it crashes in mid-flight.
This commit is contained in:
Antoine Lambert 2024-09-03 12:04:12 +02:00
parent af24960bc2
commit 927aebbd0b

View file

@ -336,7 +336,7 @@ class SourceForgeLister(Lister[SourceForgeListerState, SourceForgeListerPage]):
try:
res = self.http_request(endpoint).json()
except requests.HTTPError:
except (requests.HTTPError, 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:
except (requests.HTTPError, 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:
except (requests.HTTPError, ConnectionError):
logger.warning(
"Bazaar repository page could not be fetched, skipping project '%s'",
project,