Skip to content

Commit

Permalink
Fix TypeError if error description is None (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Wayne Parrott authored Dec 13, 2016
1 parent dc884c0 commit b607507
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions google/oauth2/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def _handle_error_response(response_body):
"""
try:
error_data = json.loads(response_body)
error_details = ': '.join([
error_details = '{}: {}'.format(
error_data['error'],
error_data.get('error_description')])
error_data.get('error_description'))
# If no details could be extracted, use the response data.
except (KeyError, ValueError):
error_details = response_body
Expand Down

0 comments on commit b607507

Please sign in to comment.