Skip to content

Commit

Permalink
When the google analytics domain is blocked the bot crashed.
Browse files Browse the repository at this point in the history
With a simple try / except this can be solved.

Fix dirty catch all
  • Loading branch information
brantje committed Aug 7, 2016
1 parent d5bb09f commit 6b2dbb3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pokemongo_bot/health_record/bot_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6b2dbb3

Please sign in to comment.