Merge pull request #74 from craigcitro/more_errors

Include error_description from code exchange failures.
This commit is contained in:
Craig Citro
2014-11-18 08:11:49 -08:00

View File

@@ -1864,7 +1864,7 @@ class OAuth2WebServerFlow(Flow):
logger.info('Failed to retrieve access token: %s', content)
if 'error' in d:
# you never know what those providers got to say
error_msg = str(d['error'])
error_msg = str(d['error']) + str(d.get('error_description', ''))
else:
error_msg = 'Invalid response: %s.' % str(resp.status)
raise FlowExchangeError(error_msg)