public Throwable getPreviousException ( ) throws ExceptionInstantiationException { Throwable ex = null ; if ( previousExceptionObject != null ) return previousExceptionObject ; if ( previousException != null ) { try { final ByteArrayInputStream bais = new ByteArrayInputStream ( previousException ) ; ObjectInputStream ois = ( ObjectInputStream ) AccessController . doPrivileged ( new PrivilegedExceptionAction ( ) { @ Override public Object run ( ) throws IOException { return new ObjectInputStream ( bais ) ; } } ) ; ex = ( Throwable ) ois . readObject ( ) ; } catch ( PrivilegedActionException pae ) { throw new ExceptionInstantiationException ( pae . getException ( ) ) ; } catch ( Exception e ) { throw new ExceptionInstantiationException ( e ) ; } } return ex ; }
Retrieves the previous exception