~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Andrew Bennetts
  • Date: 2010-07-28 07:05:19 UTC
  • mfrom: (5050.3.15 2.2)
  • mto: (5050.3.16 2.2)
  • mto: This revision was merged to the branch mainline in revision 5365.
  • Revision ID: andrew.bennetts@canonical.com-20100728070519-kkflohg6djas3ui4
Merge lp:bzr/2.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
947
947
    # original exception is available as e.original_error
948
948
    #
949
949
    # New code should prefer to raise specific subclasses
950
 
    def __init__(self, message):
951
 
        # Python 2.5 uses a slot for StandardError.message,
952
 
        # so use a different variable name.  We now work around this in
953
 
        # BzrError.__str__, but this member name is kept for compatability.
954
 
        self.msg = message
 
950
    def __init__(self, msg):
 
951
        self.msg = msg
955
952
 
956
953
 
957
954
class LockActive(LockError):
1041
1038
class LockContention(LockError):
1042
1039
 
1043
1040
    _fmt = 'Could not acquire lock "%(lock)s": %(msg)s'
1044
 
    # TODO: show full url for lock, combining the transport and relative
1045
 
    # bits?
1046
1041
 
1047
1042
    internal_error = False
1048
1043
 
1380
1375
 
1381
1376
class WeaveParentMismatch(WeaveError):
1382
1377
 
1383
 
    _fmt = "Parents are mismatched between two revisions. %(message)s"
 
1378
    _fmt = "Parents are mismatched between two revisions. %(msg)s"
1384
1379
 
1385
1380
 
1386
1381
class WeaveInvalidChecksum(WeaveError):
1387
1382
 
1388
 
    _fmt = "Text did not match it's checksum: %(message)s"
 
1383
    _fmt = "Text did not match it's checksum: %(msg)s"
1389
1384
 
1390
1385
 
1391
1386
class WeaveTextDiffers(WeaveError):
1439
1434
 
1440
1435
class VersionedFileInvalidChecksum(VersionedFileError):
1441
1436
 
1442
 
    _fmt = "Text did not match its checksum: %(message)s"
 
1437
    _fmt = "Text did not match its checksum: %(msg)s"
1443
1438
 
1444
1439
 
1445
1440
class KnitError(InternalBzrError):
1923
1918
class CantMoveRoot(BzrError):
1924
1919
 
1925
1920
    _fmt = "Moving the root directory is not supported at this time"
1926
 
    
1927
 
    
 
1921
 
 
1922
 
1928
1923
class TransformRenameFailed(BzrError):
1929
1924
 
1930
1925
    _fmt = "Failed to rename %(from_path)s to %(to_path)s: %(why)s"
1931
 
    
 
1926
 
1932
1927
    def __init__(self, from_path, to_path, why, errno):
1933
1928
        self.from_path = from_path
1934
1929
        self.to_path = to_path
3151
3146
    def __init__(self, bzrdir):
3152
3147
        self.bzrdir = bzrdir
3153
3148
 
 
3149
 
3154
3150
class NoWhoami(BzrError):
3155
3151
 
3156
3152
    _fmt = ('Unable to determine your name.\n'
3158
3154
        'E.g. bzr whoami "Your Name <name@example.com>"')
3159
3155
 
3160
3156
 
 
3157
class InvalidPattern(BzrError):
 
3158
 
 
3159
    _fmt = ('Invalid pattern(s) found. %(msg)s')
 
3160
 
 
3161
    def __init__(self, msg):
 
3162
        self.msg = msg
 
3163
 
 
3164
 
 
3165
class RecursiveBind(BzrError):
 
3166
 
 
3167
    _fmt = ('Branch "%(branch_url)s" appears to be bound to itself. '
 
3168
        'Please use `bzr unbind` to fix.')
 
3169
 
 
3170
    def __init__(self, branch_url):
 
3171
        self.branch_url = branch_url
 
3172