diff options
author | zlg <zlg@zlg.space> | 2020-03-02 21:09:00 -0800 |
---|---|---|
committer | zlg <zlg@zlg.space> | 2020-03-02 21:09:00 -0800 |
commit | 284b5946c61cc39d8aa880554ce5ba363285c5fc (patch) | |
tree | e8e2234ecb4463f65dbafcc8173b1eef75657ad1 /src/vgstash_cli.py | |
parent | Release version 0.3 beta 4 (diff) | |
download | vgstash-284b5946c61cc39d8aa880554ce5ba363285c5fc.tar.gz vgstash-284b5946c61cc39d8aa880554ce5ba363285c5fc.tar.bz2 vgstash-284b5946c61cc39d8aa880554ce5ba363285c5fc.tar.xz vgstash-284b5946c61cc39d8aa880554ce5ba363285c5fc.zip |
Avoid a backtrace when updating an invalid game
ZLG-Bug: 2
Diffstat (limited to '')
-rwxr-xr-x[-rw-r--r--] | src/vgstash_cli.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vgstash_cli.py b/src/vgstash_cli.py index b92201f..323f1d9 100644..100755 --- a/src/vgstash_cli.py +++ b/src/vgstash_cli.py @@ -158,7 +158,10 @@ def delete_game(title, system): def update_game(title, system, attr, val): # TODO: Consider namedtuple as a solution db = get_db() - target_game = db.get_game(title, system) + try: + target_game = db.get_game(title, system) + except: + click.echo("Game not found. Please try again.") if attr == 'ownership': val = vgstash.vtok(val, vgstash.OWNERSHIP) if attr == 'progress': @@ -172,7 +175,6 @@ def update_game(title, system, attr, val): ) if db.update_game(target_game, updated_game): click.echo("Updated {} for {}. Its {} is now {}.".format(title, system, attr, val)) - pass @cli.command('notes') |