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:24 UTC

[iotdb] branch py_throw_exception created (now 3cb007fb0a)

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

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


      at 3cb007fb0a Python client should throw exception when meets error

This branch includes the following new commits:

     new 3cb007fb0a Python client should throw exception when meets error

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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

Posted by ha...@apache.org.
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