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

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


The following commit(s) were added to refs/heads/master by this push:
     new 1361d28c10 add message in exception (#8449)
1361d28c10 is described below

commit 1361d28c10992db0d3f6b5d5cdef9e77c8fe3236
Author: William Song <[email protected]>
AuthorDate: Thu Dec 15 11:16:18 2022 +0800

    add message in exception (#8449)
---
 .../iotdb/consensus/exception/RatisRequestFailedException.java     | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/consensus/src/main/java/org/apache/iotdb/consensus/exception/RatisRequestFailedException.java
 
b/consensus/src/main/java/org/apache/iotdb/consensus/exception/RatisRequestFailedException.java
index 74291a47ae..0a45ea9a34 100644
--- 
a/consensus/src/main/java/org/apache/iotdb/consensus/exception/RatisRequestFailedException.java
+++ 
b/consensus/src/main/java/org/apache/iotdb/consensus/exception/RatisRequestFailedException.java
@@ -18,9 +18,14 @@
  */
 package org.apache.iotdb.consensus.exception;
 
+import java.util.Optional;
+
 public class RatisRequestFailedException extends ConsensusException {
 
   public RatisRequestFailedException(Exception cause) {
-    super("Ratis request failed", cause);
+    super(
+        "Ratis request failed "
+            + 
Optional.ofNullable(cause).map(Exception::getMessage).orElse("Unknown"),
+        cause);
   }
 }

Reply via email to