@Override public void printStackTrace(PrintStream stream){
  super.printStackTrace(stream);
  if (cause != null) {
    stream.println("Caused by:");
    cause.printStackTrace(stream);
  }
}

@ Override public void printStackTrace ( PrintStream stream ) { super . printStackTrace ( stream ) ; if ( cause != null ) { stream . println ( "Caused by:" ) ; cause . printStackTrace ( stream ) ; } }
prints this throwable and its backtrace to the specified print stream .
