Browse Source

Updates to efiling hub error handling

pull/172/head
Michael Olund 5 years ago
parent
commit
ea19710e3b
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      edivorce/apps/core/utils/efiling_submission.py

+ 5
- 2
edivorce/apps/core/utils/efiling_submission.py View File

@ -171,11 +171,14 @@ class EFilingSubmission:
response = json.loads(response.text)
if 'details' in response and len(response['details']) > 0:
return None, response['details'][0]
message = f"<p>{response['message']}</p>"
details = f"<ul><li>{'</li><li>'.join(response['details'])}</li></ul>"
return None, message + details
return None, f"{response['error']} - {response['message']}"
if response.status_code == 401:
return None, '401 - ' + str(response.headers.get('WWW-Authenticate', ''))
print(response.headers.get('WWW-Authenticate', ''))
return None, '401 - Authentication Failed'
return None, f'{response.status_code} - {response.text}'

Loading…
Cancel
Save