class Const {

  public static String getCustomStackTrace( Throwable aThrowable ) {
    final StringBuilder result = new StringBuilder();
    String errorMessage = aThrowable.toString();
    result.append( errorMessage );
    if ( !errorMessage.contains( Const.CR ) ) {
      result.append( CR );
    }

    // add each element of the stack trace
    //
    for ( StackTraceElement element : aThrowable.getStackTrace() ) {
      result.append( element );
      result.append( CR );
    }
    return result.toString();
  }

}