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, args); } catch e { printStackTrace2(e); // pcall could lead to endless loops } } }