You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by lt...@apache.org on 2019/10/28 03:42:16 UTC

[incubator-iotdb] branch fix_session_error_message created (now 19f75e1)

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

lta pushed a change to branch fix_session_error_message
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.


      at 19f75e1  fix error message output

This branch includes the following new commits:

     new 19f75e1  fix error message output

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.



[incubator-iotdb] 01/01: fix error message output

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

lta pushed a commit to branch fix_session_error_message
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit 19f75e15da4d8abde3c457743804b39c080a49d9
Author: lta <li...@163.com>
AuthorDate: Mon Oct 28 11:41:48 2019 +0800

    fix error message output
---
 session/pom.xml                                             | 4 ++++
 session/src/main/java/org/apache/iotdb/session/Session.java | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/session/pom.xml b/session/pom.xml
index 0bb58f8..28def95 100644
--- a/session/pom.xml
+++ b/session/pom.xml
@@ -88,5 +88,9 @@
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+        </dependency>
     </dependencies>
 </project>
diff --git a/session/src/main/java/org/apache/iotdb/session/Session.java b/session/src/main/java/org/apache/iotdb/session/Session.java
index 99d51a1..f5d7d54 100644
--- a/session/src/main/java/org/apache/iotdb/session/Session.java
+++ b/session/src/main/java/org/apache/iotdb/session/Session.java
@@ -26,6 +26,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.regex.Pattern;
+import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.iotdb.rpc.IoTDBRPCException;
 import org.apache.iotdb.rpc.RpcUtils;
 import org.apache.iotdb.rpc.TSStatusCode;
@@ -385,7 +386,8 @@ public class Session {
 
   private void checkPathValidity(String path) throws IoTDBSessionException {
     if (!Pattern.matches(PATH_MATCHER, path)) {
-      throw new IoTDBSessionException(String.format("Path %s is invalid", path));
+      throw new IoTDBSessionException(
+          String.format("Path [%s] is invalid", StringEscapeUtils.escapeJava(path)));
     }
   }