code: private static void printStackTrace(PrintStream out, Throwable err) {
  		out.println(err.getClass().getName() + ": " + err.getMessage());
  		for (StackTraceElement ste : err.getStackTrace()) {
  			out.println("\tat " + ste.toString());
  		}
  		if (err.getCause() != null) {
  			out.print("Caused by: ");
  			printStackTrace(out, err.getCause());
  		}
  	}
docs: Print a complete stack trace. This differs from Throwable.printStackTrace()
  in that it always prints all of the trace.
  
  @param out
  @param err