Mon, 17 Nov 2014 22:17:41 +0200
- argh
hgpoll.py | file | annotate | diff | comparison | revisions |
--- 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'^(.+) <([^>]+)>$.*')