scope dm_initErrorHandling. please include function _registerThread. please include function _threadInheritInfo. please include function _threadInfo. please include function _onAWTEnter. static new Flag #flag; svoid dm_initErrorHandling() { raiseFlagAndDo(flag, r { _handleException_addHandler(f handler); assertNull(_onRegisterThread); _onRegisterThread = voidfunc(Thread t) { DynModule m = dm_currentModule(); if (m == null) printStackTrace("New thread made outside of a module"); else m.ownTimer(t); }; _threadInfo_f = voidfunc(Map map) { mapPut(map, 'dm_currentModule_value, dm_currentModule()) }; _threadInheritInfo_retrievers.add(voidfunc(Map map) { O mod = map.get('dm_currentModule_value); if (mod instanceof DynModule) dm_currentModule_value.set(new WeakReference((DynModule) mod)); }; }); } svoid #handler(Throwable e) { DynModule m = dm_currentModule(); if (m == null) print("Weird: Error outside of module"); else m.setField(_error := persistableThrowable(e)); } end scope