Skip to content

Commit 98a80d7

Browse files
author
Tyson Holub
committed
log API Response on HTTPError
1 parent aa7aafe commit 98a80d7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python_http_client/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ def _make_request(self, opener, request, timeout=None):
185185
except HTTPError as err:
186186
exc = handle_error(err)
187187
exc.__cause__ = None
188+
_logger.info('{method} Response: {status} {body}'.format(
189+
method=request.get_method(),
190+
status=exc.status_code,
191+
body=exc.body))
188192
raise exc
189193

190194
def _(self, name):

0 commit comments

Comments
 (0)