~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Martin Packman
  • Date: 2012-01-05 10:44:12 UTC
  • mfrom: (6424 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6427.
  • Revision ID: martin.packman@canonical.com-20120105104412-z03fi9m43h946fvs
Merge bzr.dev to resolve conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Exceptions for bzr, and reporting of them.
18
18
"""
19
19
 
 
20
from __future__ import absolute_import
 
21
 
20
22
# TODO: is there any value in providing the .args field used by standard
21
23
# python exceptions?   A list of values with no names seems less useful
22
24
# to me.
761
763
        self.bzrdir = bzrdir_format
762
764
 
763
765
 
 
766
class ParseFormatError(BzrError):
 
767
 
 
768
    _fmt = "Parse error on line %(lineno)d of %(format)s format: %(line)s"
 
769
 
 
770
    def __init__(self, format, lineno, line, text):
 
771
        BzrError.__init__(self)
 
772
        self.format = format
 
773
        self.lineno = lineno
 
774
        self.line = line
 
775
        self.text = text
 
776
 
 
777
 
764
778
class IncompatibleRepositories(BzrError):
765
779
    """Report an error that two repositories are not compatible.
766
780
 
3240
3254
        self.format = format
3241
3255
 
3242
3256
 
 
3257
class MissingFeature(BzrError):
 
3258
 
 
3259
    _fmt = ("Missing feature %(feature)s not provided by this "
 
3260
            "version of Bazaar or any plugin.")
 
3261
 
 
3262
    def __init__(self, feature):
 
3263
        self.feature = feature
 
3264
 
 
3265
 
3243
3266
class PatchSyntax(BzrError):
3244
3267
    """Base class for patch syntax errors."""
3245
3268
 
3289
3312
        self.line_no = line_no
3290
3313
        self.orig_line = orig_line.rstrip('\n')
3291
3314
        self.patch_line = patch_line.rstrip('\n')
 
3315
 
 
3316
 
 
3317
class FeatureAlreadyRegistered(BzrError):
 
3318
 
 
3319
    _fmt = 'The feature %(feature)s has already been registered.'
 
3320
 
 
3321
    def __init__(self, feature):
 
3322
        self.feature = feature