static volatile Throwable _handleException_lastException; static L _handleException_onException = synchroList(ll(f printStackTrace2)); static void _handleException(Throwable e) { _handleException_lastException = e; for (O f : cloneList(_handleException_onException)) try { callF(f, e); } catch e2 { printStackTrace2(e2); // pcall could lead to endless loops } }