private static void render ( final Throwable throwable , final StringBuilder builder ) { builder . append ( throwable . getClass ( ) . getName ( ) ) ; String message = throwable . getMessage ( ) ; if ( message != null ) { builder . append ( ": " ) ; builder . append ( message ) ; } StackTraceElement [ ] stackTrace = throwable . getStackTrace ( ) ; for ( int i = 0 ; i < stackTrace . length ; ++ i ) { builder . append ( NEW_LINE ) ; builder . append ( "\tat " ) ; builder . append ( stackTrace [ i ] ) ; } Throwable cause = throwable . getCause ( ) ; if ( cause != null ) { builder . append ( NEW_LINE ) ; builder . append ( "Caused by: " ) ; render ( cause , builder ) ; } }
Renders a throwable including stack trace and cause throwables .