You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2022/01/27 12:37:41 UTC

[iotdb] branch 0.12iotdb2502 created (now 7de755c)

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

xiangweiwei pushed a change to branch 0.12iotdb2502
in repository https://gitbox.apache.org/repos/asf/iotdb.git.


      at 7de755c  add error sql

This branch includes the following new commits:

     new 7de755c  add error sql

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: add error sql

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiangweiwei pushed a commit to branch 0.12iotdb2502
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 7de755ca39ece4f6d249b841933d63a39a78598b
Author: Alima777 <wx...@gmail.com>
AuthorDate: Thu Jan 27 20:36:54 2022 +0800

    add error sql
---
 .../src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
index 2951c9c..3822804 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
@@ -1952,9 +1952,12 @@ public class TSServiceImpl implements TSIService.Iface {
 
   private TSStatus onQueryException(Exception e, String operation) {
     TSStatus status = tryCatchQueryException(e);
-    return status != null
-        ? status
-        : onNPEOrUnexpectedException(e, operation, TSStatusCode.INTERNAL_SERVER_ERROR);
+    if (status != null) {
+      LOGGER.error("Status code: {}, Query Statement: {} failed", status.getCode(), operation, e);
+      return status;
+    } else {
+      return onNPEOrUnexpectedException(e, operation, TSStatusCode.INTERNAL_SERVER_ERROR);
+    }
   }
 
   private TSStatus tryCatchQueryException(Exception e) {