Skip to content

Commit

Permalink
log server 500 error message if provided in request text
Browse files Browse the repository at this point in the history
  • Loading branch information
oliche committed Jan 10, 2024
1 parent c5db149 commit 139e1b7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions one/webclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ def _generic_request(self, reqfunction, rest_query, data=None, files=None):
message = json.loads(r.text)
message.pop('status_code', None) # Get status code from response object instead
message = message.get('detail') or message # Get details if available
_logger.error(message)
except json.decoder.JSONDecodeError:
message = r.text
raise requests.HTTPError(r.status_code, rest_query, message, response=r)
Expand Down

0 comments on commit 139e1b7

Please sign in to comment.