From b8fc82d2f60c0b92bd047e678ba89bcda940aefe Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Mon, 19 Sep 2022 15:49:20 +0100 Subject: [PATCH] feat(chalice): heatmaps search logs --- api/chalicelib/core/heatmaps.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/api/chalicelib/core/heatmaps.py b/api/chalicelib/core/heatmaps.py index 5aacb1375..fea3fb407 100644 --- a/api/chalicelib/core/heatmaps.py +++ b/api/chalicelib/core/heatmaps.py @@ -1,6 +1,5 @@ -from chalicelib.utils.TimeUTC import TimeUTC from chalicelib.utils import helper, pg_client -from chalicelib.utils import dev +from chalicelib.utils.TimeUTC import TimeUTC def get_by_url(project_id, data): @@ -22,8 +21,14 @@ def get_by_url(project_id, data): GROUP BY selector;""", args) - cur.execute( - query - ) + try: + cur.execute(query) + except Exception as err: + print("--------- HEATMAP SEARCH QUERY EXCEPTION -----------") + print(query.decode('UTF-8')) + print("--------- PAYLOAD -----------") + print(data) + print("--------------------") + raise err rows = cur.fetchall() - return helper.dict_to_camel_case(rows) + return helper.dict_to_camel_case(rows)