maven: log error message when not able to retrieve the index to read

Without this, the lister legitimately cannot list anything.
This commit is contained in:
Antoine R. Dumont (@ardumont) 2022-04-13 17:40:17 +02:00
parent 0e0901acdc
commit e4b27a1e98
No known key found for this signature in database
GPG key ID: 52E2E9840D10C3B8

View file

@ -148,10 +148,12 @@ class MavenLister(Lister[MavenListerState, RepoPage]):
# ]
# Download the main text index file.
logger.info("Downloading text index from %s.", self.INDEX_URL)
logger.info("Downloading computed index from %s.", self.INDEX_URL)
assert self.INDEX_URL is not None
response = requests.get(self.INDEX_URL, stream=True)
response.raise_for_status()
if response.status_code != 200:
logger.error("Index %s not found, stopping", self.INDEX_URL)
response.raise_for_status()
# Prepare regexes to parse index exports.