Skip to content
This repository has been archived by the owner on Sep 3, 2023. It is now read-only.

Commit

Permalink
fix: don't fail update check if GitHub API is down
Browse files Browse the repository at this point in the history
Fixes #159
  • Loading branch information
ericswpark committed May 22, 2023
1 parent ce495f5 commit 8187955
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions shippy/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,17 @@ def check_token_validity(client):

def check_shippy_update():
with console.status("Please wait while shippy checks for updates... "):
r = requests.get(
"https://api.github.com/repos/shipperstack/shippy/releases/latest"
)
latest_version = r.json()["name"]
try:
r = requests.get(
"https://api.github.com/repos/shipperstack/shippy/releases/latest"
)
latest_version = r.json()["name"]
except KeyError:
print_error(
"Failed to contact the GitHub API to check the latest version.",
newline=True,
exit_after=False,
)

# Check if user is running an alpha/beta build
if is_prerelease():
Expand Down

0 comments on commit 8187955

Please sign in to comment.