mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 11:02:21 -05:00
Catch all requests exceptions
This commit is contained in:
parent
dbb0e551fc
commit
ad29d18bc0
@ -29,7 +29,7 @@ class TraktAPI():
|
||||
data=json.dumps(data), timeout=self.timeout, verify=self.verify)
|
||||
resp.raise_for_status()
|
||||
resp = resp.json()
|
||||
except (requests.HTTPError, requests.ConnectionError) as e:
|
||||
except requests.RequestException as e:
|
||||
code = getattr(e.response, 'status_code', None)
|
||||
if not code:
|
||||
# This is pretty much a fatal error if there is no status_code
|
||||
@ -68,7 +68,7 @@ class TraktAPI():
|
||||
|
||||
# convert response to json
|
||||
resp = resp.json()
|
||||
except (requests.HTTPError, requests.ConnectionError) as e:
|
||||
except requests.RequestException as e:
|
||||
code = getattr(e.response, 'status_code', None)
|
||||
if not code:
|
||||
# This is pretty much a fatal error if there is no status_code
|
||||
|
Loading…
Reference in New Issue
Block a user