private static String getErrorMessage ( CliExecutionException e ) { StringBuffer messageBuilder = new StringBuffer ( ) ; Throwable current = e ; do { messageBuilder . append ( "-> " ) ; messageBuilder . append ( current . getMessage ( ) ) ; current = current . getCause ( ) ; } while ( current != null ) ; return messageBuilder . toString ( ) ; }
Extract an error message from the given exception and its causes .