]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Route all callback error logging in IOLoop through handle_callback_exception.
authorBen Darnell <ben@bendarnell.com>
Sun, 4 Aug 2013 19:45:35 +0000 (15:45 -0400)
committerBen Darnell <ben@bendarnell.com>
Sun, 4 Aug 2013 20:04:42 +0000 (16:04 -0400)
tornado/ioloop.py

index fc61904e189c2e0328f254bbc8b8239bd680bb4c..c9f2e47c534ad5cefafb462169ddfe19f19c4e32 100644 (file)
@@ -682,11 +682,9 @@ class PollIOLoop(IOLoop):
                         # Happens when the client closes the connection
                         pass
                     else:
-                        app_log.error("Exception in I/O handler for fd %s",
-                                      fd, exc_info=True)
+                        self.handle_callback_exception(self._handlers.get(fd))
                 except Exception:
-                    app_log.error("Exception in I/O handler for fd %s",
-                                  fd, exc_info=True)
+                    self.handle_callback_exception(self._handlers.get(fd))
         # reset the stopped flag so another start/stop pair can be issued
         self._stopped = False
         if self._blocking_signal_threshold is not None:
@@ -820,7 +818,7 @@ class PeriodicCallback(object):
         try:
             self.callback()
         except Exception:
-            app_log.error("Error in periodic callback", exc_info=True)
+            self.io_loop.handle_callback_exception(self.callback)
         self._schedule_next()
 
     def _schedule_next(self):