From 6b2dbb33865295a3844669330154e0f04ec917b7 Mon Sep 17 00:00:00 2001 From: brantje Date: Sun, 7 Aug 2016 13:05:16 +0200 Subject: [PATCH] When the google analytics domain is blocked the bot crashed. With a simple try / except this can be solved. Fix dirty catch all --- pokemongo_bot/health_record/bot_event.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pokemongo_bot/health_record/bot_event.py b/pokemongo_bot/health_record/bot_event.py index 36c323f791..f357a4e8e7 100644 --- a/pokemongo_bot/health_record/bot_event.py +++ b/pokemongo_bot/health_record/bot_event.py @@ -73,8 +73,10 @@ def track_url(self, path): 't': 'pageview', 'dp': path } + try: + response = requests.post( + 'http://www.google-analytics.com/collect', data=data) - response = requests.post( - 'http://www.google-analytics.com/collect', data=data) - - response.raise_for_status() + response.raise_for_status() + except requests.exceptions.HTTPError: + pass