Skip to content

Commit 8e48500

Browse files
committed
Fix error parser
1 parent 9118595 commit 8e48500

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

singlestoredb/http/connection.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,10 @@ def _execute(
569569

570570
if res.status_code >= 400:
571571
if res.text:
572-
if re.match(r'^Error\s+\d+:', res.text):
573-
code, msg = res.text.split(':', 1)
572+
m = re.match(r'^Error\s+(\d+).*?:', res.text)
573+
if m:
574+
code = m.group(1)
575+
msg = res.text.split(':', 1)[-1]
574576
icode = int(code.split()[-1])
575577
else:
576578
icode = res.status_code

0 commit comments

Comments
 (0)