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:34:52 UTC

[iotdb] 01/01: add error sql

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

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

commit bbfd16e473db3d8a3d741236a8633c0bb0161b16
Author: Alima777 <wx...@gmail.com>
AuthorDate: Thu Jan 27 20:33:45 2022 +0800

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

diff --git a/server/src/main/java/org/apache/iotdb/db/utils/ErrorHandlingUtils.java b/server/src/main/java/org/apache/iotdb/db/utils/ErrorHandlingUtils.java
index e3e2d8a..22c8df8 100644
--- a/server/src/main/java/org/apache/iotdb/db/utils/ErrorHandlingUtils.java
+++ b/server/src/main/java/org/apache/iotdb/db/utils/ErrorHandlingUtils.java
@@ -77,9 +77,12 @@ public class ErrorHandlingUtils {
 
   public static 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);
+    }
   }
 
   public static TSStatus onQueryException(Exception e, OperationType operation) {