diff --git a/f7/app.py b/f7/app.py index 9c8d238..28238b3 100644 --- a/f7/app.py +++ b/f7/app.py @@ -99,7 +99,7 @@ class _App: if msgid == _IM_DoneCallback: self._IMDoneCallback(callback) except Exception as e: - f7.udplog.error('_dispatchIMMsg ' + str(e)) + f7.udplog.error('_dispatchIMMsg %d %s' % (msgid, str(e))) def _addIMMsg(self, msgid, callback): self._immsgLock.acquire() @@ -112,8 +112,12 @@ class _App: callback() def createAsyncTask(self, done_callback, func, *args): + assert self._listened def thread_func(args): - func(args) + try: + func(args) + except Exception as e: + f7.udplog.error('_dispatchIMMsg ' + str(e)) if done_callback: self._addIMMsg(_IM_DoneCallback, done_callback) thread = threading.Thread(target = thread_func, args = args)