From 7e2e3676ed21b72893702b1e58e6698a40ec982c Mon Sep 17 00:00:00 2001 From: ErnestaP Date: Thu, 25 Jan 2024 11:04:09 +0100 Subject: [PATCH] common: create_or_update_article error details --- dags/common/utils.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dags/common/utils.py b/dags/common/utils.py index de04535c..aed660b3 100644 --- a/dags/common/utils.py +++ b/dags/common/utils.py @@ -253,5 +253,11 @@ def create_or_update_article(data): data=json.dumps(data), headers=headers, ) - response.raise_for_status() - return response.json() + try: + response.raise_for_status() + return response.json() + except requests.HTTPError: + response.raise_for_status() + logger.error(response.data) + +