Don't log exceptions that we know aren't bugs when adding events to event queues

(imported from commit 55074e68603119bd11cc5218453a4e1eab710feb)
This commit is contained in:
Zev Benjamin
2013-12-10 18:21:51 -05:00
parent 9ace9232b7
commit fb602da502

View File

@@ -100,6 +100,7 @@ class ClientDescriptor(object):
def finish_current_handler(self):
if self.current_handler is not None:
err_msg = "Got error finishing handler for queue %s" % (self.event_queue.id,)
try:
# We call async_request_restart here in case we are
# being finished without any events (because another
@@ -111,8 +112,14 @@ class ClientDescriptor(object):
queue_id=self.event_queue.id),
self.current_handler._request,
apply_markdown=self.apply_markdown)
except IOError as e:
if e.message != 'Stream is closed':
logging.exception(err_msg)
except AssertionError as e:
if e.message != 'Request closed':
logging.exception(err_msg)
except Exception:
logging.exception("Got error finishing handler for queue %s" % (self.event_queue.id))
logging.exception(err_msg)
finally:
self.disconnect_handler()
return True