/** * @see org.opencms.main.CmsException#createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable) */ @Override public CmsException createException(CmsMessageContainer container, Throwable cause) { if (cause instanceof CmsMultiException) { CmsMultiException multiException = (CmsMultiException)cause; return new CmsMultiException(multiException.getExceptions()); } // not a multi exception, use standard handling return super.createException(container, cause); }
/** * @see org.opencms.main.CmsException#createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable) */ @Override public CmsException createException(CmsMessageContainer container, Throwable cause) { if (cause instanceof CmsMultiException) { CmsMultiException multiException = (CmsMultiException)cause; return new CmsMultiException(multiException.getExceptions()); } // not a multi exception, use standard handling return super.createException(container, cause); }
/** * Returns an exception of the same type as <code>throwable</code>, if <code>throwable</code> is an OpenCms Exception * with the message as a {@link CmsMessageContainer} and the <code>throwable</code> as a cause.<p> * * @param message the message container for the exception to create * @param throwable the cause of the exception * * @throws CmsException if the <code>throwable</code> parameter is not <code>null</code> and a {@link CmsException} * @throws CmsVfsException if the <code>throwable</code> parameter is not <code>null</code> and no {@link CmsException} */ public void throwException(CmsMessageContainer message, Throwable throwable) throws CmsVfsException, CmsException { if (throwable instanceof CmsException) { throw ((CmsException)throwable).createException(message, throwable); } else if (throwable instanceof CmsRuntimeException) { throw ((CmsRuntimeException)throwable).createException(message, throwable); } else { throw new CmsVfsException(message, throwable); } } }
/** * Returns an Exception of the same type as throwable if throwable is an OpenCms Exception * with the message as a MessageContainer and the throwable as a cause.<p> * * @param message the MessageContainer for the Exception to create * @param throwable the cause of the exception * * @throws CmsVfsException if throwable is not an OpenCms Exception * @throws CmsException of the same type as throwable if throwable is an OpenCms Exception */ void throwException(CmsMessageContainer message, Throwable throwable) throws CmsVfsException, CmsException { if (throwable instanceof CmsException) { throw ((CmsException)throwable).createException(message, throwable); } else if (throwable instanceof CmsRuntimeException) { throw ((CmsRuntimeException)throwable).createException(message, throwable); } else { throw new CmsVfsException(message, throwable); } } }