Include error_description from code exchange failures.

This commit is contained in:
Craig Citro
2014-11-14 09:11:01 -08:00
parent 92418e2938
commit cb3d520527

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)