From 1d7840b984d20261df241e39db0d8089a831f5b3 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 13 Jan 2020 17:55:58 +0800 Subject: [PATCH] 1 --- f7/app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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)