Fixing KeyError on error handling (#834)

This commit is contained in:
Asbjørn Kjær 2017-06-14 09:07:27 -07:00 committed by kevgliss
parent b5fd802005
commit e77382864b
1 changed files with 2 additions and 2 deletions

View File

@ -169,7 +169,7 @@ def handle_response(response):
:return:
"""
if response.status_code > 399:
raise Exception(response.json()['message'])
raise Exception(response.json()['errors'][0]['message'])
return response.json()
@ -297,7 +297,7 @@ class DigiCertIssuerPlugin(IssuerPlugin):
response = self.session.post(determinator_url, data=json.dumps(data))
if response.status_code > 399:
raise Exception(response.json()['message'])
raise Exception(response.json()['errors'][0]['message'])
order_id = response.json()['id']