Private
Public Access
1
0

catching attributeerror

This commit is contained in:
Sander Roosendaal
2017-02-25 20:01:37 +01:00
parent 4a4869afb4
commit 7d4d0c08a8

View File

@@ -354,7 +354,10 @@ def get_token(code):
try: try:
status_code = token_json['status_code'] status_code = token_json['status_code']
except KeyError: except KeyError:
try:
status_code = token_json.status_code status_code = token_json.status_code
except AttributeError:
return (0,'Attribute Error on c2_get_token')
if status_code == 200: if status_code == 200:
thetoken = token_json['access_token'] thetoken = token_json['access_token']