# HG changeset patch # User Teemu Piippo # Date 1416255461 -7200 # Node ID 31fb8c355ef933476a16498b39531a872b6f8f6f # Parent 9e757b6025867d5763c2bbb50625a72f60ad2065 - argh diff -r 9e757b602586 -r 31fb8c355ef9 hgpoll.py --- a/hgpoll.py Mon Nov 17 22:14:58 2014 +0200 +++ b/hgpoll.py Mon Nov 17 22:17:41 2014 +0200 @@ -69,6 +69,13 @@ print 'Unable to clone %s from %s: %s' % (repo_name, repo_url, str (`e`)) quit (1) + +class HgProcessError (Exception): + def __init__ (self, value): + self.message = value + def __str__ (self): + return self.message + def announce_ticket_resolved (ticket_id, commit_node): zanrepo = hgapi.Repo ('zandronum-everything') @@ -77,8 +84,7 @@ '{author|nonempty}\n{date(date, \'%A %d %B %Y %T\')}').split('\n') if len (moredata) != 2: - Irc.broadcast ('error while processing %s: malformed hg data' % commit_node) - continue + raise HgProcessError ('malformed hg data while processing %s' % commit_node) commit_author = moredata[0] commit_date = moredata[1] @@ -87,8 +93,7 @@ try: ticket_data = Bt.get_issue (ticket_id) except Exception as e: - Irc.broadcast ('error while processing %s: %s' % (commit_node, `e`)) - continue + raise HgProcessError ("error while processing %s: %s" % (commit_node, e)) # Remove the email address from the author if possible rex = re.compile (r'^(.+) <([^>]+)>$.*')