/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: Michael Ellerman
  • Date: 2005-10-26 10:03:47 UTC
  • mfrom: (1185.16.116)
  • mto: (1185.16.126)
  • mto: This revision was merged to the branch mainline in revision 1488.
  • Revision ID: michael@ellerman.id.au-20051026100347-bb0b2bd42f7953f2
MergeĀ mainline.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: UTF-8 -*-
 
1
# (C) 2005 Canonical
2
2
 
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
101
101
class BzrCheckError(BzrNewError):
102
102
    """Internal check failed: %(message)s"""
103
103
    def __init__(self, message):
 
104
        BzrNewError.__init__(self)
104
105
        self.message = message
105
106
 
106
107
 
107
108
class InvalidEntryName(BzrNewError):
108
109
    """Invalid entry name: %(name)s"""
109
110
    def __init__(self, name):
 
111
        BzrNewError.__init__(self)
110
112
        self.name = name
111
113
 
112
114
 
113
115
class InvalidRevisionNumber(BzrNewError):
114
116
    """Invalid revision number %(revno)d"""
115
117
    def __init__(self, revno):
 
118
        BzrNewError.__init__(self)
116
119
        self.revno = revno
117
120
 
118
121
 
119
122
class InvalidRevisionId(BzrNewError):
120
 
    """Invalid revision-id"""
 
123
    """Invalid revision-id {%(revision_id)s} in %(branch)s"""
 
124
    def __init__(self, revision_id, branch):
 
125
        BzrNewError.__init__(self)
 
126
        self.revision_id = revision_id
 
127
        self.branch = branch
121
128
 
122
129
 
123
130
class BzrCommandError(BzrError):
270
277
        BzrError.__init__(self, "Stores for branch %s are not listable" % br)
271
278
 
272
279
 
273
 
from bzrlib.weave import WeaveError, WeaveParentMismatch
 
280
class WeaveError(BzrNewError):
 
281
    """Error in processing weave: %(message)s"""
 
282
    def __init__(self, message=None):
 
283
        BzrNewError.__init__(self)
 
284
        self.message = message
 
285
 
 
286
 
 
287
class WeaveRevisionAlreadyPresent(WeaveError):
 
288
    """Revision {%(revision_id)s} already present in %(weave)s"""
 
289
    def __init__(self, revision_id, weave):
 
290
        WeaveError.__init__(self)
 
291
        self.revision_id = revision_id
 
292
        self.weave = weave
 
293
 
 
294
 
 
295
class WeaveRevisionNotPresent(WeaveError):
 
296
    """Revision {%(revision_id)s} not present in %(weave)s"""
 
297
    def __init__(self, revision_id, weave):
 
298
        WeaveError.__init__(self)
 
299
        self.revision_id = revision_id
 
300
        self.weave = weave
 
301
 
 
302
 
 
303
class WeaveFormatError(WeaveError):
 
304
    """Weave invariant violated: %(what)s"""
 
305
    def __init__(self, what):
 
306
        WeaveError.__init__(self)
 
307
        self.what = what
 
308
 
 
309
 
 
310
class WeaveParentMismatch(WeaveError):
 
311
    """Parents are mismatched between two revisions."""
 
312
    
274
313
 
275
314
class TransportError(BzrError):
276
315
    """All errors thrown by Transport implementations should derive
333
372
    def __init__(self):
334
373
        BzrError.__init__(self, "Working tree has conflicts.")
335
374
 
 
375
class ParseConfigError(BzrError):
 
376
    def __init__(self, errors, filename):
 
377
        if filename is None:
 
378
            filename = ""
 
379
        message = "Error(s) parsing config file %s:\n%s" % \
 
380
            (filename, ('\n'.join(e.message for e in errors)))
 
381
        BzrError.__init__(self, message)
 
382
 
336
383
class SigningFailed(BzrError):
337
384
    def __init__(self, command_line):
338
385
        BzrError.__init__(self, "Failed to gpg sign data with command '%s'"
339
386
                               % command_line)
 
387
 
 
388
class GraphCycleError(BzrNewError):
 
389
    """Cycle in graph %(graph)r"""
 
390
    def __init__(self, graph):
 
391
        BzrNewError.__init__(self)
 
392
        self.graph = graph