mirror of
https://github.com/mvt-project/mvt.git
synced 2026-08-17 08:30:38 +02:00
Fix error reporting for update check failures (#555)
This commit is contained in:
+14
-8
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user