/** * Returns the stack trace (including the message) of an exception as a String.<p> * * If the exception is a CmsException, * also writes the root cause to the String.<p> * * @param e the exception to get the stack trace from * @return the stack trace of an exception as a String */ public static String getStackTraceAsString(Throwable e) { StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); e.printStackTrace(printWriter); if (e instanceof CmsMultiException) { CmsMultiException me = (CmsMultiException)e; Iterator it = me.getExceptions().iterator(); while (it.hasNext()) { Throwable t = (Throwable)it.next(); t.printStackTrace(printWriter); } } return stringWriter.toString(); }
/** * Returns the stack trace (including the message) of an exception as a String.<p> * * If the exception is a CmsException, * also writes the root cause to the String.<p> * * @param e the exception to get the stack trace from * @return the stack trace of an exception as a String */ public static String getStackTraceAsString(Throwable e) { StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); e.printStackTrace(printWriter); if (e instanceof CmsMultiException) { CmsMultiException me = (CmsMultiException)e; Iterator<CmsException> it = me.getExceptions().iterator(); while (it.hasNext()) { Throwable t = it.next(); t.printStackTrace(printWriter); } } return stringWriter.toString(); }
/** * @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); }
resourceIssues.addExceptions(permissionIssues.getExceptions()); throw resourceIssues;
if (!me.getExceptions().isEmpty()) { throw me;
resourceIssues.addExceptions(permissionIssues.getExceptions()); throw resourceIssues;
if (!me.getExceptions().isEmpty()) { throw me;