better messaging of exceptions

This commit is contained in:
Hossein Shafagh 2020-10-22 17:10:32 -07:00
parent 02c040865d
commit 1c96ea9ab1
1 changed files with 6 additions and 3 deletions

View File

@ -221,10 +221,13 @@ def handle_cis_response(response):
:param response:
:return:
"""
if response.status_code > 399:
raise Exception(response.text)
return response.json()
if response.status_code == 404:
raise Exception("DigiCert: Order not in issued state.")
elif response.status_code == 406:
raise Exception("DigiCert: Wrong Header")
elif response.status_code > 399:
raise Exception("DigiCert rejected request with the error:" + response.text)
@retry(stop_max_attempt_number=10, wait_fixed=10000)