more fancy error catching in c2stuff
This commit is contained in:
@@ -351,7 +351,12 @@ def get_token(code):
|
|||||||
|
|
||||||
token_json = response.json()
|
token_json = response.json()
|
||||||
|
|
||||||
if token_json['status_code'] == 200:
|
try:
|
||||||
|
status_code = token_json['status_code']
|
||||||
|
except KeyError:
|
||||||
|
status_code = token_json.status_code
|
||||||
|
|
||||||
|
if status_code == 200:
|
||||||
thetoken = token_json['access_token']
|
thetoken = token_json['access_token']
|
||||||
expires_in = token_json['expires_in']
|
expires_in = token_json['expires_in']
|
||||||
refresh_token = token_json['refresh_token']
|
refresh_token = token_json['refresh_token']
|
||||||
|
|||||||
Reference in New Issue
Block a user