Skip to content
Snippets Groups Projects
Commit 927aebbd authored by Antoine Lambert's avatar Antoine Lambert
Browse files

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.
parent af24960b
No related branches found
Tags v6.8.0
1 merge request!534sourceforge: Also skip ConnectionError when fetching project info
Pipeline #10686 passed
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment