Skip to content

Commit ec3ce7c

Browse files
authored
Merge pull request #7 from lotrekagency/fix/missing-error-description
fix(exceptions): using get() method while getting ErrorDescription ke…
2 parents 049ff9d + e3165fc commit ec3ce7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mailupy/exceptions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ class MailupyRequestException(MailupyException):
1515
"""
1616
def __init__(self, response):
1717
super(MailupyException, self).__init__(
18-
f"Error {response.status_code} - {response.json()['ErrorDescription']}"
18+
f"Error {response.status_code} - {response.json().get('ErrorDescription', 'No description available')}"
1919
)

0 commit comments

Comments
 (0)