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(lambda1 handler); assertNull(_onRegisterThread); _onRegisterThread = voidfunc(Thread t) { O m = dm_current_generic(); if (m == null) printStackTrace("New thread made outside of a module"); else if (m cast DynModule) m.ownTimer(t); }; _threadInfo_makers.add(voidfunc(Map map) { mapPut(map, "currentModule", dm_currentModule()) }); _threadInheritInfo_retrievers.add(voidfunc(Map map) { O mod = map.get("currentModule"); if (mod cast DynModule) dm_current_generic_tl().set(new WeakReference(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