/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
            s = str(s)
135
135
        return s
136
136
 
 
137
    def __repr__(self):
 
138
        return '%s(%s)' % (self.__class__.__name__, str(self))
 
139
 
137
140
    def _get_format_string(self):
138
141
        """Return format string for this exception or None"""
139
142
        fmt = getattr(self, '_fmt', None)
1424
1427
        self.how = how
1425
1428
 
1426
1429
 
 
1430
class SHA1KnitCorrupt(KnitCorrupt):
 
1431
 
 
1432
    _fmt = ("Knit %(filename)s corrupt: sha-1 of reconstructed text does not "
 
1433
        "match expected sha-1. key %(key)s expected sha %(expected)s actual "
 
1434
        "sha %(actual)s")
 
1435
 
 
1436
    def __init__(self, filename, actual, expected, key, content):
 
1437
        KnitError.__init__(self)
 
1438
        self.filename = filename
 
1439
        self.actual = actual
 
1440
        self.expected = expected
 
1441
        self.key = key
 
1442
        self.content = content
 
1443
 
 
1444
 
1427
1445
class KnitDataStreamIncompatible(KnitError):
1428
1446
    # Not raised anymore, as we can convert data streams.  In future we may
1429
1447
    # need it again for more exotic cases, so we're keeping it around for now.
2890
2908
    def __init__(self, msg):
2891
2909
        self.msg = msg
2892
2910
 
 
2911
 
 
2912
class ShelfCorrupt(BzrError):
 
2913
 
 
2914
    _fmt = "Shelf corrupt."
 
2915
 
 
2916
 
 
2917
class NoSuchShelfId(BzrError):
 
2918
 
 
2919
    _fmt = 'No changes are shelved with id "%(shelf_id)d".'
 
2920
 
 
2921
    def __init__(self, shelf_id):
 
2922
        BzrError.__init__(self, shelf_id=shelf_id)
 
2923
 
 
2924
 
 
2925
class UserAbort(BzrError):
 
2926
 
 
2927
    _fmt = 'The user aborted the operation.'