static volatile PersistableThrowable _handleException_lastException; static L _handleException_onException = synchroList(ll((IVF1) lambda1 printStackTrace2)); sbool _handleException_showThreadCancellations; svoid _handleException(Throwable e) { _handleException_lastException = persistableThrowable(e); Throwable e2 = innerException(e); if (e2.getClass() == RuntimeException.class && eq(e2.getMessage(), "Thread cancelled.") || e2 instanceof InterruptedException) { if (_handleException_showThreadCancellations) System.out.println(getStackTrace_noRecord(e2)); ret; } for (O f : cloneList(_handleException_onException)) try { callF(f, e); } catch e3 { try { printStackTrace2(e3); // not using pcall here - it could lead to endless loops } catch e4 { System.out.println(getStackTrace(e3)); System.out.println(getStackTrace(e4)); } } }