{"action":"created","issue":{"url":"https://api.github.com/repos/mixpanel/mixpanel-python/issues/33","labels_url":"https://api.github.com/repos/mixpanel/mixpanel-python/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/mixpanel/mixpanel-python/issues/33/comments","events_url":"https://api.github.com/repos/mixpanel/mixpanel-python/issues/33/events","html_url":"https://github.com/mixpanel/mixpanel-python/pull/33","id":53446689,"number":33,"title":"Call MixpanelException on general URLError","user":{"login":"naoyak","id":3279641,"avatar_url":"https://avatars.githubusercontent.com/u/3279641?v=3","gravatar_id":"","url":"https://api.github.com/users/naoyak","html_url":"https://github.com/naoyak","followers_url":"https://api.github.com/users/naoyak/followers","following_url":"https://api.github.com/users/naoyak/following{/other_user}","gists_url":"https://api.github.com/users/naoyak/gists{/gist_id}","starred_url":"https://api.github.com/users/naoyak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naoyak/subscriptions","organizations_url":"https://api.github.com/users/naoyak/orgs","repos_url":"https://api.github.com/users/naoyak/repos","events_url":"https://api.github.com/users/naoyak/events{/privacy}","received_events_url":"https://api.github.com/users/naoyak/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mixpanel/mixpanel-python/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"joeatwork","id":106866,"avatar_url":"https://avatars.githubusercontent.com/u/106866?v=3","gravatar_id":"","url":"https://api.github.com/users/joeatwork","html_url":"https://github.com/joeatwork","followers_url":"https://api.github.com/users/joeatwork/followers","following_url":"https://api.github.com/users/joeatwork/following{/other_user}","gists_url":"https://api.github.com/users/joeatwork/gists{/gist_id}","starred_url":"https://api.github.com/users/joeatwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeatwork/subscriptions","organizations_url":"https://api.github.com/users/joeatwork/orgs","repos_url":"https://api.github.com/users/joeatwork/repos","events_url":"https://api.github.com/users/joeatwork/events{/privacy}","received_events_url":"https://api.github.com/users/joeatwork/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-01-05T20:55:46Z","updated_at":"2015-02-25T20:50:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mixpanel/mixpanel-python/pulls/33","html_url":"https://github.com/mixpanel/mixpanel-python/pull/33","diff_url":"https://github.com/mixpanel/mixpanel-python/pull/33.diff","patch_url":"https://github.com/mixpanel/mixpanel-python/pull/33.patch"},"body":"In our implementation we were intermittently experiencing connectivity issues causing this error:\r\n\r\n```\r\nFile \"/home/ubuntu/.virtualenvs/gb/local/lib/python2.7/site-packages/mixpanel/__init__.py\", line 74, in track\r\n    self._consumer.send('events', json.dumps(event, separators=(',', ':')))\r\n  File \"/home/ubuntu/.virtualenvs/gb/local/lib/python2.7/site-packages/mixpanel/__init__.py\", line 335, in send\r\n    self._write_request(self._endpoints[endpoint], json_message, api_key)\r\n  File \"/home/ubuntu/.virtualenvs/gb/local/lib/python2.7/site-packages/mixpanel/__init__.py\", line 350, in _write_request\r\n    response = urllib2.urlopen(request).read()\r\n  File \"/usr/lib/python2.7/urllib2.py\", line 126, in urlopen\r\n    return _opener.open(url, data, timeout)\r\n  File \"/usr/lib/python2.7/urllib2.py\", line 394, in open\r\n    response = self._open(req, data)\r\n  File \"/usr/lib/python2.7/urllib2.py\", line 412, in _open\r\n    '_open', req)\r\n  File \"/usr/lib/python2.7/urllib2.py\", line 372, in _call_chain\r\n    result = func(*args)\r\n  File \"/usr/lib/python2.7/urllib2.py\", line 1209, in https_open\r\n    return self.do_open(httplib.HTTPSConnection, req)\r\n  File \"/usr/lib/python2.7/urllib2.py\", line 1171, in do_open\r\n    raise URLError(err)\r\nURLError: <urlopen error [Errno 104] Connection reset by peer>\r\n```\r\n\r\nThis PR proposes to trigger a `MixpanelException` on the more general `URLError` in place of `HTTPError`."},"comment":{"url":"https://api.github.com/repos/mixpanel/mixpanel-python/issues/comments/76053498","html_url":"https://github.com/mixpanel/mixpanel-python/pull/33#issuecomment-76053498","issue_url":"https://api.github.com/repos/mixpanel/mixpanel-python/issues/33","id":76053498,"user":{"login":"joeatwork","id":106866,"avatar_url":"https://avatars.githubusercontent.com/u/106866?v=3","gravatar_id":"","url":"https://api.github.com/users/joeatwork","html_url":"https://github.com/joeatwork","followers_url":"https://api.github.com/users/joeatwork/followers","following_url":"https://api.github.com/users/joeatwork/following{/other_user}","gists_url":"https://api.github.com/users/joeatwork/gists{/gist_id}","starred_url":"https://api.github.com/users/joeatwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeatwork/subscriptions","organizations_url":"https://api.github.com/users/joeatwork/orgs","repos_url":"https://api.github.com/users/joeatwork/repos","events_url":"https://api.github.com/users/joeatwork/events{/privacy}","received_events_url":"https://api.github.com/users/joeatwork/received_events","type":"User","site_admin":false},"created_at":"2015-02-25T20:50:02Z","updated_at":"2015-02-25T20:50:02Z","body":"We still want this feature in a release, but it may be a bit until we merge it- we're trying to come up with am error handling story that works with possibly asynchronous consumers and still stays appropriately out of user's face in simple cases. It's almost certain, however, that this PRQ will get in in some form eventually.\r\n\r\nSorry I don't have an ETA- you're welcome to check back here (or even ping support) if you've got issues you're interested in. "}}