chore: Improve error handling in mmdb-asn and mmdb-country scripts

This commit is contained in:
Théophile Diot 2024-06-10 10:00:39 +01:00
parent dc9774f386
commit c3a903dc98
No known key found for this signature in database
GPG key ID: FA995104A0BA376A
2 changed files with 4 additions and 4 deletions

View file

@ -84,8 +84,8 @@ try:
for chunk in resp.iter_content(chunk_size=4 * 1024):
if chunk:
file_content.write(chunk)
except RequestException:
LOGGER.error(f"Error while downloading mmdb file from {mmdb_url}")
except RequestException as e:
LOGGER.error(f"Error while downloading mmdb file from {mmdb_url}: {e}")
sys_exit(2)
try:

View file

@ -84,8 +84,8 @@ try:
for chunk in resp.iter_content(chunk_size=4 * 1024):
if chunk:
file_content.write(chunk)
except RequestException:
LOGGER.error(f"Error while downloading mmdb file from {mmdb_url}")
except RequestException as e:
LOGGER.error(f"Error while downloading mmdb file from {mmdb_url}: {e}")
sys_exit(2)
try: