Skip to content
This repository was archived by the owner on Dec 29, 2023. It is now read-only.

Commit 9eacecd

Browse files
authored
Flexible error handler
1 parent b6be866 commit 9eacecd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def play():
7575
query = query.encode('utf-8')
7676

7777
if body is not None:
78+
# temporary hack to flatten multilines. to be replaced with raw `--file` input
7879
data = f""
7980
request_lines = body.decode('utf-8').strip().splitlines(True)
8081
for line in request_lines:
@@ -92,6 +93,9 @@ def play():
9293
result, errmsg = chdb_query_with_errmsg(query.strip(), format)
9394
if len(errmsg) == 0:
9495
return result, 200
96+
if len(result) > 0:
97+
print("warning:", errmsg)
98+
return result, 200
9599
return errmsg, 400
96100

97101

0 commit comments

Comments
 (0)