public static Throwable getRootCause ( Throwable exception ) { Assert . notNull ( exception ) ; return exception . getCause ( ) == null ? exception : getRootCause ( exception . getCause ( ) ) ; }
Returns the innermost cause of the specified exception . If the specified exception has no cause the exception itself is returned .