From 9eacecde70e34a79af6ba409b9fc56a1d31eec2d Mon Sep 17 00:00:00 2001 From: Lorenzo Mangani Date: Sun, 12 Nov 2023 12:48:21 +0100 Subject: [PATCH] Flexible error handler --- main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.py b/main.py index 64df409..a815fc1 100644 --- a/main.py +++ b/main.py @@ -75,6 +75,7 @@ def play(): query = query.encode('utf-8') if body is not None: + # temporary hack to flatten multilines. to be replaced with raw `--file` input data = f"" request_lines = body.decode('utf-8').strip().splitlines(True) for line in request_lines: @@ -92,6 +93,9 @@ def play(): result, errmsg = chdb_query_with_errmsg(query.strip(), format) if len(errmsg) == 0: return result, 200 + if len(result) > 0: + print("warning:", errmsg) + return result, 200 return errmsg, 400