wuchong commented on a change in pull request #15383: URL: https://github.com/apache/flink/pull/15383#discussion_r602673701
########## File path: flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliStrings.java ########## @@ -353,13 +354,19 @@ public static AttributedString messageWarning(String message) { .toAttributedString(); } - public static AttributedString messageError(String message, Throwable t) { - while (t.getCause() != null - && t.getCause().getMessage() != null - && !t.getCause().getMessage().isEmpty()) { - t = t.getCause(); + public static AttributedString messageError(String message, Throwable t, boolean isVerbose) { + String expMessage; + if (isVerbose) { + expMessage = ExceptionUtils.getStackTrace(t); Review comment: We should also get rid of empty cause to have better exception stack trace. The top cause may be `SqlExecutionException` which is unnecessary to print. -- 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