/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

  • Committer: Andrew Bennetts
  • Date: 2008-10-01 06:10:17 UTC
  • mfrom: (3753 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3755.
  • Revision ID: andrew.bennetts@canonical.com-20081001061017-z97p3m0n9qqjzklf
Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
        parameters.
82
82
 
83
83
        :param msg: If given, this is the literal complete text for the error,
84
 
        not subject to expansion.
 
84
           not subject to expansion. 'msg' is used instead of 'message' because
 
85
           python evolved and, in 2.6, forbids the use of 'message'.
85
86
        """
86
87
        StandardError.__init__(self)
87
88
        if msg is not None:
102
103
            fmt = self._get_format_string()
103
104
            if fmt:
104
105
                d = dict(self.__dict__)
105
 
                # special case: python2.5 puts the 'message' attribute in a
106
 
                # slot, so it isn't seen in __dict__
107
 
                d['message'] = getattr(self, 'message', 'no message')
108
106
                s = fmt % d
109
107
                # __str__() should always return a 'str' object
110
108
                # never a 'unicode' object.
126
124
            # return a unicode object.
127
125
            u = unicode(u)
128
126
        return u
129
 
    
 
127
 
130
128
    def __str__(self):
131
129
        s = self._format()
132
130
        if isinstance(s, unicode):
204
202
 
205
203
 
206
204
class AlreadyBuilding(BzrError):
207
 
    
 
205
 
208
206
    _fmt = "The tree builder is already building a tree."
209
207
 
210
208
 
216
214
 
217
215
 
218
216
class BzrCheckError(InternalBzrError):
219
 
    
220
 
    _fmt = "Internal check failed: %(message)s"
221
 
 
222
 
    def __init__(self, message):
 
217
 
 
218
    _fmt = "Internal check failed: %(msg)s"
 
219
 
 
220
    def __init__(self, msg):
223
221
        BzrError.__init__(self)
224
 
        self.message = message
 
222
        self.msg = msg
225
223
 
226
224
 
227
225
class DirstateCorrupt(BzrError):
1310
1308
 
1311
1309
class WeaveError(BzrError):
1312
1310
 
1313
 
    _fmt = "Error in processing weave: %(message)s"
 
1311
    _fmt = "Error in processing weave: %(msg)s"
1314
1312
 
1315
 
    def __init__(self, message=None):
 
1313
    def __init__(self, msg=None):
1316
1314
        BzrError.__init__(self)
1317
 
        self.message = message
 
1315
        self.msg = msg
1318
1316
 
1319
1317
 
1320
1318
class WeaveRevisionAlreadyPresent(WeaveError):
1673
1671
        if filename is None:
1674
1672
            filename = ""
1675
1673
        message = "Error(s) parsing config file %s:\n%s" % \
1676
 
            (filename, ('\n'.join(e.message for e in errors)))
 
1674
            (filename, ('\n'.join(e.msg for e in errors)))
1677
1675
        BzrError.__init__(self, message)
1678
1676
 
1679
1677