Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch all requests exceptions #868

Merged
merged 3 commits into from
Aug 10, 2016
Merged

Catch all requests exceptions #868

merged 3 commits into from
Aug 10, 2016

Conversation

fernandog
Copy link
Contributor

@fernandog fernandog commented Aug 9, 2016

Need to fix #856

Requests.exceptions.ConnectionError is not being catched. any idea?
looks like an error inside another error

2016-08-09 18:14:29 ERROR    DAILYSEARCHER :: [8ae98dd] Exception generated in thread DAILYSEARCHER: error HTTPSConnectionPool(host='cdn.pymedusa.com', port=443): Max retries exceeded with url: /sb_network_timezones/network_timezones.txt (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x69eca530>: Failed to establish a new connection: [Errno -2] Nome ou servi\xc3\xa7o desconhecido',))
Traceback (most recent call last):
  File "/home/osmc/SickRage/sickbeard/scheduler.py", line 106, in run
    self.action.run(self.force)
  File "/home/osmc/SickRage/sickbeard/dailysearcher.py", line 75, in run
    update_network_dict()
  File "/home/osmc/SickRage/sickbeard/network_timezones.py", line 47, in update_network_dict
    url_data = helpers.getURL(url, session=helpers.make_session(), returns='response')
  File "/home/osmc/SickRage/sickbeard/helpers.py", line 1337, in getURL
    verify=verify)
  File "/home/osmc/SickRage/lib/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/osmc/SickRage/lib/requests/sessions.py", line 585, in send
    r = adapter.send(request, **kwargs)
  File "/home/osmc/SickRage/lib/cachecontrol/adapter.py", line 46, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "/home/osmc/SickRage/lib/requests/adapters.py", line 467, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPSConnectionPool(host='cdn.pymedusa.com', port=443): Max retries exceeded with url: /sb_network_timezones/network_timezones.txt (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x69eca530>: Failed to establish a new connection: [Errno -2] Nome ou servi\xc3\xa7o desconhecido',))

@medariox @ratoaq2

@ratoaq2
Copy link
Contributor

ratoaq2 commented Aug 10, 2016

I didn't get it. The old code is actually catching ConnectionError

@fernandog
Copy link
Contributor Author

@ratoaq2 yes. But labs rewrote another part.

Line 1337 as in the error

@medariox
Copy link
Contributor

medariox commented Aug 10, 2016

Approved

Approved with PullApprove

@medariox medariox added this to the 0.1.4 milestone Aug 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants