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

Commit 4920482

Browse files
committed
refactor(updater): Catch errors within updater
Errors are now caught within the updater. This had been patched by wrapping around the call to updater, previously. WIP #43
1 parent 2a9701e commit 4920482

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

gitcommit/gitcommit.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,7 @@ def run():
423423
elif confirm in confirmation_validator.rejections:
424424
print("Aborting the commit...")
425425

426-
try:
427-
check_for_update()
428-
except:
429-
print("An error occured whilst checking for updates.")
426+
check_for_update()
430427

431428

432429
def main():

gitcommit/updater.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ def find_version():
3535

3636

3737
def check_for_update():
38-
tags = get_github_tags()
38+
try:
39+
tags = get_github_tags()
40+
except Exception as e:
41+
print(
42+
"An error occured whilst checking for updates. Check your network connection."
43+
)
44+
return
3945
latest_tag_version = tags[0][1:]
4046
cur_version = find_version()
4147

0 commit comments

Comments
 (0)