Fix error reporting for update check failures (#555)

This commit is contained in:
Donncha Ó Cearbhaill
2024-10-17 13:26:53 +02:00
committed by GitHub
parent f4bf3f362b
commit 5ef19a327c
+14 -8
View File
@@ -18,10 +18,13 @@ def check_updates() -> None:
try: try:
mvt_updates = MVTUpdates() mvt_updates = MVTUpdates()
latest_version = mvt_updates.check() latest_version = mvt_updates.check()
except requests.exceptions.Timeout: except (requests.exceptions.ConnectionError, requests.exceptions.Timeout):
log.verbose("Couldn't check latest MVT version") rich_print(
except Exception: "\t\t[bold]Note: Could not check for MVT updates.[/bold] "
pass "You may be working offline. Please update MVT regularly."
)
except Exception as e:
log.error("Error encountered when trying to check latest MVT version: %s", e)
else: else:
if latest_version: if latest_version:
rich_print( rich_print(
@@ -54,10 +57,13 @@ def check_updates() -> None:
try: try:
ioc_to_update = ioc_updates.check() ioc_to_update = ioc_updates.check()
except requests.exceptions.Timeout: except (requests.exceptions.ConnectionError, requests.exceptions.Timeout):
log.verbose("Couldn't check latest indicators") rich_print(
except Exception: "\t\t[bold]Note: Could not check for indicator updates.[/bold] "
pass "You may be working offline. Please update MVT indicators regularly."
)
except Exception as e:
log.error("Error encountered when trying to check latest MVT indicators: %s", e)
else: else:
if ioc_to_update: if ioc_to_update:
rich_print( rich_print(