Throws the cause of the given exception, even though it may be
checked. If the cause is null, then the original exception is
thrown. This method only returns normally if the exception is null.

@param t exception whose cause is to be thrown
174069
public static void fireCause(Throwable t) {
        if (t != null) {
            Throwable cause = t.getCause();
            if (cause == null) {
                cause = t;
            }
            fire(cause);
        }
    }
57144
private void printException(Runnable r, Throwable t) {
		if (t == null && r instanceof Future<?>) {
			try {
				Future<?> future = (Future<?>) r;
				if (future.isDone())
					future.get();
			} catch (CancellationException ce) {
				t = ce;
			} catch (ExecutionException ee) {
				t = ee.getCause();
			} catch (InterruptedException ie) {
				Thread.currentThread().interrupt(); // ignore/reset
			}
		}
		if (t != null)
			logger.error(t.getMessage(), t);
	}
283944
public static String printStackTrace(Throwable t) {
        return t == null ? PcConstants.NA : ExceptionUtils.getStackTrace(t);

    }
242293
public void throwIfNotEmpty() {
        synchronized (nested) {
            if (nested.isEmpty()) {
                // Do nothing
            } else if (nested.size() == 1) {
                Throwable t = nested.get(0);
                TigerThrower.sneakyThrow(t);
            } else {
                throw this;
            }
        }
    }
766114
public static boolean causedBy( final Throwable                     ex,
                                    final Class<? extends Throwable>    exceptionClass )
    {
        Throwable    cause = ex;

        while( cause != null && ! exceptionClass.isInstance( cause ) )
        {
            cause = cause.getCause();
        }

        return ( cause == null ) ? false : true;
    }
946732
private void setLogicalCloseException(final Throwable t) {

      if(logicalCloseException == null) {
         logicalCloseException = t;
      } else if(!Util.isRuntimeError(logicalCloseException) && Util.isRuntimeError(t)) {
         logicalCloseException = t;
      }
   }
1039845
public static void asUnchecked(Throwable t, Class<? extends RuntimeException> checkedExceptionWrapper) {
        if (t instanceof AssertionError) {
            throw (AssertionError) t;
        } else if (t instanceof RuntimeException) {
            throw (RuntimeException) t;
        } else {
            RuntimeException exception;
            try {
                exception = checkedExceptionWrapper.getConstructor(Throwable.class).newInstance(t);
            } catch (Exception e) {
                throw new RuntimeException(t);
            }
            throw exception;
        }
    }
1361995
public <T> T invoke(Callable<T> c) throws Exception {
        try {
            T result = c.call();
            succeed();
            return result;
        } catch (Exception e) {
            fail();
            throw e;
        }
    }
42534
public void error(Object message, Throwable t) {
        doLog(Level.ERROR, FQCN, message, null, t);
    }
60134
public static Throwable throwIfIOE(Throwable t) throws IOException {
        if (t instanceof IOException) {
            throw (IOException)t;
        }
        return t;
    }
569147
@Override
    public void afterExecute(Runnable r, Throwable t)
    {
        super.afterExecute(r,t);
        DebuggableThreadPoolExecutor.logExceptionsAfterExecute(r, t);
    }
604802
public static String getExceptionStacktrace(Throwable t) {
        try (StringWriter errors = new StringWriter()) {
            t.printStackTrace(new PrintWriter(errors));
            return errors.toString();
        } catch (IOException e) {
            LOG.error(e);
            return null;
        }
    }
1064614
@Override
    public void error(Throwable t) {
        log.log(Level.SEVERE, t.getMessage(), t);
    }
256901
public static void fireRootCause(Throwable t) {
        Throwable root = t;
        while (root != null) {
            Throwable cause = root.getCause();
            if (cause == null) {
                break;
            }
            root = cause;
        }
        fire(root);
    }
788366
public static void throwException(Throwable t) {
        if (hasUnsafe()) {
            PlatformDependent0.throwException(t);
        } else {
            PlatformDependent.<RuntimeException>throwException0(t);
        }
    }
507592
protected void handleException(Throwable t) {

        if (LOG.isErrorEnabled()) {
            LOG.error(Messages.get().getBundle().key(Messages.LOG_ERR_JSP_BEAN_0), t);
        }
        if (!(m_isSupressingExceptions || getRequestContext().getCurrentProject().isOnlineProject())) {
            if (LOG.isDebugEnabled()) {
                // no stack trace needed since it was already logged with the "error" log message above
                LOG.debug(
                    Messages.get().getBundle().key(Messages.LOG_DEBUG_INTERRUPTED_EXCEPTION_1, getClass().getName()));
            }
            String uri = null;
            Throwable u = getController().getThrowable();
            if (u != null) {
                uri = getController().getThrowableResourceUri();
            } else {
                uri = getRequestContext().getUri();
            }
            throw new CmsRuntimeException(
                Messages.get().container(Messages.ERR_RUNTIME_1, (uri != null) ? uri : getClass().getName()),
                t);
        }
    }
20099
private int onException(Exception e) throws IOException {
        eofReached = true;
        if (e instanceof IOException) {
            throw (IOException) e;
        } else if (e instanceof RuntimeException) {
            throw (RuntimeException) e;
        } else {
            // Impossible since InputStream throws no other checked exceptions.
            throw Throwables.failure(e);
        }
    }