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:
		@@ -146,13 +146,17 @@ class RecheckWatch(threading.Thread):
 | 
				
			|||||||
            rev = event['patchSet']['number']
 | 
					            rev = event['patchSet']['number']
 | 
				
			||||||
            change_id = "%s,%s" % (change, rev)
 | 
					            change_id = "%s,%s" % (change, rev)
 | 
				
			||||||
            project = event['change']['project']
 | 
					            project = event['change']['project']
 | 
				
			||||||
            bug_numbers = classifier.classify(change, rev, event['comment'])
 | 
					            try:
 | 
				
			||||||
 | 
					                bug_numbers = classifier.classify(change, rev,
 | 
				
			||||||
 | 
					                                                  event['comment'])
 | 
				
			||||||
                if not bug_numbers:
 | 
					                if not bug_numbers:
 | 
				
			||||||
                    self._read(event)
 | 
					                    self._read(event)
 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
                    event['bug_numbers'] = bug_numbers
 | 
					                    event['bug_numbers'] = bug_numbers
 | 
				
			||||||
                    self._read(event)
 | 
					                    self._read(event)
 | 
				
			||||||
                    stream.leave_comment(project, change_id, bug_numbers)
 | 
					                    stream.leave_comment(project, change_id, bug_numbers)
 | 
				
			||||||
 | 
					            except Exception:
 | 
				
			||||||
 | 
					                self.log.exception("Uncaught exception processing event.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ChannelConfig(object):
 | 
					class ChannelConfig(object):
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user