public static Throwable getCause ( Throwable thr ) { Throwable cause = thr . getCause ( ) ; while ( cause != null && cause != thr && cause != cause . getCause ( ) && cause . getCause ( ) != null ) { cause = cause . getCause ( ) ; } return cause == null ? thr : cause ; }
Replies the cause of the given exception .