private static void addCauseToBacktrace ( final Throwable cause , final List < String > bTrace ) { if ( cause . getMessage ( ) == null ) { bTrace . add ( BT_CAUSED_BY_PREFIX + cause . getClass ( ) . getName ( ) ) ; } else { bTrace . add ( BT_CAUSED_BY_PREFIX + cause . getClass ( ) . getName ( ) + ": " + cause . getMessage ( ) ) ; } for ( final StackTraceElement ste : cause . getStackTrace ( ) ) { bTrace . add ( BT_PREFIX + ste . toString ( ) ) ; } if ( cause . getCause ( ) != null ) { addCauseToBacktrace ( cause . getCause ( ) , bTrace ) ; } }
Add a cause to the backtrace .