/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

partial merge from Martin, fixed conflicts with bzrlib/tree.py and revno 1391

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
 
47
47
 * the printable form of an exception is generated by the base class
48
48
   __str__ method
 
49
 
 
50
Exception strings should start with a capital letter and not have a final
 
51
fullstop.
49
52
"""
50
53
 
51
54
# based on Scott James Remnant's hct error classes
133
136
    def __init__(self, base):
134
137
        BzrNewError.__init__(self)
135
138
        self.base = base
136
 
        
 
139
 
137
140
 
138
141
class BzrCommandError(BzrError):
139
142
    # Error from malformed user command
363
366
        TransportError.__init__(self, msg=msg, orig_error=orig_error)
364
367
        IOError.__init__(self, errno.ENOENT, self.msg)
365
368
 
 
369
class ConnectionError(TransportError, IOError):
 
370
    """
 
371
    A connection problem prevents file retrieval.
 
372
    This does not indicate whether the file exists or not; it indicates that a
 
373
    precondition for requesting the file was not met.
 
374
    """
 
375
 
 
376
    # XXX: Is multiple inheritance for exceptions really needed?
 
377
 
 
378
    def __str__(self):
 
379
        return 'connection error: ' + self.msg
 
380
 
 
381
    def __init__(self, msg=None, orig_error=None):
 
382
        import errno
 
383
        TransportError.__init__(self, msg=msg, orig_error=orig_error)
 
384
        IOError.__init__(self, errno.ENOENT, self.msg)
 
385
 
 
386
 
366
387
class FileExists(TransportError, OSError):
367
388
    """An operation was attempted, which would overwrite an entry,
368
389
    but overwritting is not supported.
416
437
        BzrNewError.__init__(self)
417
438
        self.graph = graph
418
439
 
 
440
class NotConflicted(BzrNewError):
 
441
    """File %(filename)s is not conflicted."""
 
442
    def __init__(self, filename):
 
443
        BzrNewError.__init__(self)
 
444
        self.filename = filename
 
445
 
419
446
class MustUseDecorated(Exception):
420
447
    """A decorating function has requested its original command be used.
421
448