InternalException re = new InternalException(msg); re.setStackTrace(t.getStackTrace()); return re;
else if ( IllegalArgumentException.class.isAssignableFrom( t.getClass() )) { ApiUsageException aue = new ApiUsageException( t.getMessage() ); aue.setStackTrace( t.getStackTrace() ); log.warn("IllegalArgumentException thrown:\n"+aue.getStackTrace()); return aue; }  else {  InternalException re = new InternalException(msg); re.setStackTrace(t.getStackTrace()); return re; }
    protected Throwable getAndLogException(Throwable t){        if (null == t)        {            log.error("Exception thrown. (null)");            return new InternalException("Exception thrown with null message");        }         else {            String msg = " Wrapped Exception: ("                + t.getClass().getName()+"):\n"                + t.getMessage();                        log.error("Exception thrown: "+msg);                        if ( RootException.class.isAssignableFrom( t.getClass() ) )                 return t;                        // Wrap all non-RootExceptions in InternalException            InternalException re = new InternalException(msg);            re.setStackTrace(t.getStackTrace());            return re;                    }                }