Skip to content

Commit

Permalink
Include error message in the description (#48)
Browse files Browse the repository at this point in the history
In many cases the error message is passed directly instead of the errors list, so include it as well.
  • Loading branch information
nijel authored Feb 13, 2020
1 parent c800627 commit d483fff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion freshdesk/v2/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,9 @@ def _action(self, req):
error_message = 'Freshdesk Request Failed'
if 'errors' in j:
error_message = '{}: {}'.format(j.get('description'), j.get('errors'))

elif 'message' in j:
error_message = j['message']

if req.status_code == 400:
raise FreshdeskBadRequest(error_message)
elif req.status_code == 401:
Expand Down

0 comments on commit d483fff

Please sign in to comment.