Skip to content

Commit b83a366

Browse files
committed
Catch disconnected pre-flight check
1 parent aeaef00 commit b83a366

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

activity_browser/__main__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,11 @@ def check_pyside_version():
208208

209209
def check_conda_update():
210210
ab_url = "https://api.anaconda.org/package/lca/activity-browser"
211-
ab_response = requests.get(ab_url)
211+
try:
212+
ab_response = requests.get(ab_url)
213+
except:
214+
print("Could not fetch latest Activity Browser version")
215+
return
212216
ab_current = metadata.version("activity_browser")
213217
print(f"Activity Browser version: {ab_current}")
214218

@@ -223,7 +227,11 @@ def check_conda_update():
223227

224228
def check_pypi_update():
225229
ab_url = "https://pypi.org/pypi/activity-browser/json"
226-
ab_response = requests.get(ab_url)
230+
try:
231+
ab_response = requests.get(ab_url)
232+
except:
233+
print("Could not fetch latest Activity Browser version")
234+
return
227235
ab_current = metadata.version("activity_browser")
228236
print(f"Activity Browser version: {ab_current}")
229237

0 commit comments

Comments
 (0)