Skip to content

Commit

Permalink
Handle ConnectionError without a response
Browse files Browse the repository at this point in the history
E.g.:

```
ConnectionError: HTTPSConnectionPool(host='api.soundcloud.com',
port=443): Max retries exceeded with url:
/me.json?client_id=XXX (Caused by
NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection
object at 0x7f4356c37550>: Failed to establish a new connection: [Errno
-2] Name or service not known',))
```
  • Loading branch information
blueyed committed Nov 28, 2015
1 parent 97488d9 commit feff686
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mopidy_soundcloud/soundcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self, config):
try:
self._get('me.json')
except Exception as err:
if err.response.status_code == 401:
if err.response is not None and err.response.status_code == 401:
logger.error('Invalid "auth_token" used for SoundCloud '
'authentication!')
else:
Expand Down

0 comments on commit feff686

Please sign in to comment.