Skip to content

Commit

Permalink
fix: checkupdate does not crash the whole CLI when run without inte…
Browse files Browse the repository at this point in the history
…rnet connection
  • Loading branch information
hitblast committed Jul 13, 2024
1 parent 4834d94 commit 912f3d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion avro/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ def _reverse(
# usage: avro checkupdate
@cli.command("checkupdate", help="Check for version updates.")
def _checkupdate() -> None:
req = requests.get("https://api.github.com/repos/hitblast/avro.py/tags")
try:
req = requests.get("https://api.github.com/repos/hitblast/avro.py/tags")
except requests.exceptions.RequestException:
return _print_err("Failed to fetch latest version information.")

latest_version = req.json()[0]["name"]

if latest_version == avro.__version__:
Expand Down

0 comments on commit 912f3d5

Please sign in to comment.