~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/errors.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-05-23 18:43:31 UTC
  • mfrom: (13084.2.6 page-match-rewrite-url)
  • Revision ID: launchpad@pqm.canonical.com-20110523184331-dhd2c7cgfuu49epw
[r=sinzui][bug=784273] Adds facility to the PageMatch to handle bad
        URIs

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    'NoSuchBranch',
33
33
    'PrivateBranchRecipe',
34
34
    'ReviewNotPending',
35
 
    'StaleLastMirrored',
36
35
    'TooManyBuilds',
37
36
    'TooNewRecipeFormat',
38
37
    'UnknownBranchTypeError',
187
186
class BranchMergeProposalExists(InvalidBranchMergeProposal):
188
187
    """Raised if there is already a matching BranchMergeProposal."""
189
188
 
190
 
    webservice_error(400)  # Bad request.
 
189
    webservice_error(400) #Bad request.
191
190
 
192
191
 
193
192
class InvalidNamespace(Exception):
217
216
    _message_prefix = "No such branch"
218
217
 
219
218
 
220
 
class StaleLastMirrored(Exception):
221
 
    """Raised when last_mirrored_id is out of date with on-disk value."""
222
 
 
223
 
    def __init__(self, db_branch, info):
224
 
        """Constructor.
225
 
 
226
 
        :param db_branch: The database branch.
227
 
        :param info: A dict of information about the branch, as produced by
228
 
            lp.codehosting.bzrutils.get_branch_info
229
 
        """
230
 
        self.db_branch = db_branch
231
 
        self.info = info
232
 
        Exception.__init__(
233
 
            self,
234
 
            'Database last_mirrored_id %s does not match on-disk value %s' %
235
 
            (db_branch.last_mirrored_id, self.info['last_revision_id']))
236
 
 
237
 
 
238
219
class PrivateBranchRecipe(Exception):
239
220
 
240
221
    webservice_error(400)