The Exceptions You Should Not Catch
public static void catchFooter(Throwable t) {
        if (t == null) return;
        Throwable t2 = unnest(t);
        checkTimeout(t2.getMessage());
 
        if (t2 instanceof ConcurrentModificationException) {
            dumpStacks();
            throw Threads.rethrowException(t2);
        }
        if (t2 instanceof TimeoutException || t2 instanceof RejectedExecutionException || t2 instanceof Error)
            throw Threads.rethrowException(t2);
 
        if (t2 instanceof IllegalMonitorStateException)
            throw Threads.rethrowException(new InterruptedException(t2.toString()));
 
        // only reset an interrupt if this thread threw it.
        if (t2 instanceof InterruptedException && !(t instanceof ExecutionException))
            Thread.currentThread().interrupt();
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License