diff --git a/pokemongo_bot/cell_workers/telegram_task.py b/pokemongo_bot/cell_workers/telegram_task.py index f9c421aff5..c5bdd2ae58 100644 --- a/pokemongo_bot/cell_workers/telegram_task.py +++ b/pokemongo_bot/cell_workers/telegram_task.py @@ -102,7 +102,7 @@ def _get_player_stats(self): try: with open(web_inventory, "r") as infile: json_inventory = json.load(infile) - except ValueError: + except ValueError as e: # Unable to read json from web inventory # File may be corrupt. Create a new one. self.bot.logger.info('[x] Error while opening inventory file for read: %s' % e) diff --git a/pokemongo_bot/inventory.py b/pokemongo_bot/inventory.py index d4a2efc5f3..461de2b6f7 100644 --- a/pokemongo_bot/inventory.py +++ b/pokemongo_bot/inventory.py @@ -1211,7 +1211,7 @@ def update_web_inventory(self): try: with open(web_inventory, "w") as outfile: json.dump(json_inventory, outfile) - except (IOError, ValueError): + except (IOError, ValueError) as e: self.bot.logger.info('[x] Error while opening inventory file for write: %s' % e, 'red') pass except: