File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ def main_task(target):
111111 thread .start ()
112112
113113 def send_task_command (self , command ):
114- """向会话发送来自协程内的消息
114+ """向会话发送来自pywebio应用的消息
115115
116116 :param dict command: 消息
117117 """
@@ -252,10 +252,12 @@ def _dispatch_callback_event(self):
252252 def run (callback ):
253253 try :
254254 callback (event ['data' ])
255- except Exception :
255+ except Exception as e :
256256 # 子类可能会重写 get_current_session ,所以不要用 ThreadBasedSession.get_current_session 来调用
257- self .get_current_session ().on_task_exception ()
258- # todo: clean up from `register_thread()`
257+ if not isinstance (e , SessionException ):
258+ self .on_task_exception ()
259+
260+ # todo: good to have -> clean up from `register_thread()`
259261
260262 if mutex :
261263 run (callback )
You can’t perform that action at this time.
0 commit comments