Added error description to AccessTokenRefreshError

The JSON response returned can contain an "error_description" field that contains additional information about the error. If found, appending to the error message.
This commit is contained in:
Eric Koleda
2014-09-19 17:15:00 -04:00
parent 89448c19f5
commit 5bb8bd8d56

View File

@@ -760,6 +760,8 @@ class OAuth2Credentials(Credentials):
d = json.loads(content)
if 'error' in d:
error_msg = d['error']
if 'error_description' in d:
error_msg += ': ' + d['error_description']
self.invalid = True
if self.store:
self.store.locked_put(self)