Skip to content

Commit

Permalink
Added KeyError exception protection in telegram_handler.py. (#5163)
Browse files Browse the repository at this point in the history
  • Loading branch information
solderzzc authored Sep 4, 2016
1 parent fbe9ff0 commit de49375
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pokemongo_bot/event_handlers/telegram_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ def handle_event(self, event, sender, level, formatted_msg, data):
else:
return
elif event == 'egg_hatched':
msg = "Egg hatched with a {} CP: {}, IV: {}".format(data["pokemon"], data["cp"], data["iv"])
try:
msg = "Egg hatched with a {} CP: {}, IV: {}".format(data["pokemon"], data["cp"], data["iv"])
except KeyError:
return
elif event == 'catch_limit':
self.tbot.send_player_stats_to_chat(master)
msg = "*You have reached your daily catch limit, quitting.*"
Expand Down

0 comments on commit de49375

Please sign in to comment.