File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 44from collections import defaultdict
55
66import user_agents
7-
8- from ..utils import catch_exp_call
7+ from ..exceptions import SessionException
98
109logger = logging .getLogger (__name__ )
1110
@@ -119,7 +118,13 @@ def close(self, nonblock=False):
119118 self .deferred_functions .reverse ()
120119 while self .deferred_functions :
121120 func = self .deferred_functions .pop ()
122- catch_exp_call (func , logger )
121+ try :
122+ func ()
123+ except Exception as e :
124+ msg = "Error occurred when running deferred function %s" % func
125+ if isinstance (e , SessionException ):
126+ msg = "PyWebIO interactive functions cannot be called inside the deferred functions."
127+ logger .exception (msg )
123128
124129 def closed (self ) -> bool :
125130 return self ._closed
You can’t perform that action at this time.
0 commit comments