Make sure Bantracker/Launchpad raises a BugNotFoundError

This commit is contained in:
Terence Simpson
2011-03-17 20:56:42 +00:00
parent 8bd3a656d5
commit 928fc13794

View File

@ -736,6 +736,8 @@ class Launchpad(IBugtracker):
#NOTE: The LP API will raise a lazr.restfulclient.errors.HTTPError with private bugs, so bugdata.private is useless..., do the checking here instead
if e.__class__.__name__ == 'HTTPError': # messy, but meh
raise BugtrackerError, e.content # should be 'Bug nnnnn is private'
elif isinstance(e, KeyError):
raise BugNotFoundError
supylog.exception("Error gathering bug data for %s bug %d" % (self.description, id))
s = 'Could not parse data returned by %s: %s (%s/bugs/%d)' % (self.description, e, self.url, id)
raise BugtrackerError, s