add some status protection

This commit is contained in:
clowwindy 2014-06-06 22:52:02 +08:00
parent d88d2802b0
commit a185e1671b
3 changed files with 18 additions and 4 deletions

View file

@ -204,9 +204,11 @@ class EventLoop(object):
logging.error(e)
continue
for handler in self._handlers:
# no exceptions should be raised by users
# TODO when there are a lot of handlers
handler(events)
try:
handler(events)
except (OSError, IOError) as e:
logging.error(e)
# from tornado