// if it's not EJBTransactionRolledbackException
if(!(t instanceof EJBTransactionRolledbackException))
{
if(t instanceof Error)
{
t = new EJBTransactionRolledbackException(formatException("Unexpected Error", t));
}
// If this is an EJBException, pass through to the caller
else if (t instanceof EJBException || t instanceof RemoteException)
{
// Leave Exception as-is (this is in place to handle specifically, and not
// as a generic RuntimeException
}
else if(t instanceof RuntimeException)
{
t = new EJBTransactionRolledbackException(t.getMessage(), (Exception) t);
}
else // application exception
{
throw t;
}