From f5d1ffe27c195c44ff102e6d8362a8efeb7e524c Mon Sep 17 00:00:00 2001 From: jo Date: Thu, 5 Aug 2021 13:58:50 +0200 Subject: [PATCH] Better failed request logging in api_client v1 --- python_apps/api_clients/api_clients/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python_apps/api_clients/api_clients/utils.py b/python_apps/api_clients/api_clients/utils.py index 6d7413045..90a3f40cd 100644 --- a/python_apps/api_clients/api_clients/utils.py +++ b/python_apps/api_clients/api_clients/utils.py @@ -121,8 +121,9 @@ class ApiRequest: raise except requests.exceptions.HTTPError: self.logger.error( - f"HTTP request to '{res.request.url}' failed" - f" with status '{res.status_code}':\n{res.text}" + f"{res.request.method} {res.request.url} request failed '{res.status_code}':" + f"\nPayload: {res.request.body}" + f"\nResponse: {res.text}" ) raise