wuchong commented on a change in pull request #15383:
URL: https://github.com/apache/flink/pull/15383#discussion_r602302785



##########
File path: 
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliStrings.java
##########
@@ -353,13 +354,14 @@ public static AttributedString messageWarning(String 
message) {
                 .toAttributedString();
     }
 
-    public static AttributedString messageError(String message, Throwable t) {
+    public static AttributedString messageError(String message, Throwable t, 
boolean isVerbose) {
         while (t.getCause() != null
                 && t.getCause().getMessage() != null
                 && !t.getCause().getMessage().isEmpty()) {
             t = t.getCause();
         }
-        return messageError(message, t.getClass().getName() + ": " + 
t.getMessage());
+        String expMessage = isVerbose ? ExceptionUtils.getStackTrace(t) : 
t.getMessage();

Review comment:
       Flink has a util 
`org.apache.flink.util.ExceptionUtils#stringifyException` for this purpose, we 
should avoid to depend on other projects as much as possible. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to