Log uncaught exceptions in bot's run loop.

* elastic_recheck/bot.py: Catch uncaught exceptions in the IRC bot's run
loop. Do this to log errors that would otherwise kill the bot's thread
without logging anything.

Change-Id: I56373bdefcfadb1855e526822a88dd6d3cba7a92
This commit is contained in:
Clark Boylan
2013-10-17 10:11:11 -07:00
parent 492142a5dd
commit a019c9e4d0

View File

@@ -146,13 +146,17 @@ class RecheckWatch(threading.Thread):
rev = event['patchSet']['number']
change_id = "%s,%s" % (change, rev)
project = event['change']['project']
bug_numbers = classifier.classify(change, rev, event['comment'])
if not bug_numbers:
self._read(event)
else:
event['bug_numbers'] = bug_numbers
self._read(event)
stream.leave_comment(project, change_id, bug_numbers)
try:
bug_numbers = classifier.classify(change, rev,
event['comment'])
if not bug_numbers:
self._read(event)
else:
event['bug_numbers'] = bug_numbers
self._read(event)
stream.leave_comment(project, change_id, bug_numbers)
except Exception:
self.log.exception("Uncaught exception processing event.")
class ChannelConfig(object):