You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2023/03/13 01:32:25 UTC

[iotdb] 01/01: Python client should throw exception when meets error

This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch py_throw_exception
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 3cb007fb0a4a6ecda2a1b08a88bca1a1d66ae079
Author: HTHou <hh...@outlook.com>
AuthorDate: Mon Mar 13 09:32:08 2023 +0800

    Python client should throw exception when meets error
---
 client-py/iotdb/Session.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/client-py/iotdb/Session.py b/client-py/iotdb/Session.py
index c32ecc8b34..01c73fbb37 100644
--- a/client-py/iotdb/Session.py
+++ b/client-py/iotdb/Session.py
@@ -1054,7 +1054,9 @@ class Session(object):
             return 0
 
         logger.error("error status is %s", status)
-        return -1
+        raise RuntimeError(
+            "execution of statement fails because: {}", status.message
+        )
 
     def execute_raw_data_query(
         self, paths: list, start_time: int, end_time: int