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

Commit

Permalink
refactor(updater): Catch errors within updater
Browse files Browse the repository at this point in the history
Errors are now caught within the updater. This had been patched by
wrapping around the call to updater, previously.

WIP #43
  • Loading branch information
nebbles committed Dec 25, 2019
1 parent 2a9701e commit 4920482
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 1 addition & 4 deletions gitcommit/gitcommit.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,7 @@ def run():
elif confirm in confirmation_validator.rejections:
print("Aborting the commit...")

try:
check_for_update()
except:
print("An error occured whilst checking for updates.")
check_for_update()


def main():
Expand Down
8 changes: 7 additions & 1 deletion gitcommit/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ def find_version():


def check_for_update():
tags = get_github_tags()
try:
tags = get_github_tags()
except Exception as e:
print(
"An error occured whilst checking for updates. Check your network connection."
)
return
latest_tag_version = tags[0][1:]
cur_version = find_version()

Expand Down

0 comments on commit 4920482

Please sign in to comment.