/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: Martin Pool
  • Date: 2008-05-27 08:12:28 UTC
  • mfrom: (3453 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3455.
  • Revision ID: mbp@sourcefrog.net-20080527081228-2ft0nnz7edsz1jfa
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
562
562
        PathError.__init__(self, base, reason)
563
563
 
564
564
 
 
565
class UnavailableRepresentation(InternalBzrError):
 
566
 
 
567
    _fmt = ("The encoding '%(wanted)s' is not available for key %(key)s which "
 
568
        "is encoded as '%(native)s'.")
 
569
 
 
570
    def __init__(self, key, wanted, native):
 
571
        InternalBzrError.__init__(self)
 
572
        self.wanted = wanted
 
573
        self.native = native
 
574
        self.key = key
 
575
 
 
576
 
565
577
class UnknownHook(BzrError):
566
578
 
567
579
    _fmt = "The %(type)s hook '%(hook)s' is unknown in this version of bzrlib."
894
906
        self.obj = obj
895
907
 
896
908
 
897
 
class ReadOnlyLockError(LockError):
898
 
 
899
 
    _fmt = "Cannot acquire write lock on %(fname)s. %(msg)s"
900
 
 
901
 
    @symbol_versioning.deprecated_method(symbol_versioning.zero_ninetytwo)
902
 
    def __init__(self, fname, msg):
903
 
        LockError.__init__(self, '')
904
 
        self.fname = fname
905
 
        self.msg = msg
906
 
 
907
 
 
908
909
class LockFailed(LockError):
909
910
 
910
911
    internal_error = False
1066
1067
        BzrError.__init__(self, branch=branch, revision=revision)
1067
1068
 
1068
1069
 
1069
 
# zero_ninetyone: this exception is no longer raised and should be removed
1070
 
class NotLeftParentDescendant(InternalBzrError):
1071
 
 
1072
 
    _fmt = ("Revision %(old_revision)s is not the left parent of"
1073
 
            " %(new_revision)s, but branch %(branch_location)s expects this")
1074
 
 
1075
 
    def __init__(self, branch, old_revision, new_revision):
1076
 
        BzrError.__init__(self, branch_location=branch.base,
1077
 
                          old_revision=old_revision,
1078
 
                          new_revision=new_revision)
1079
 
 
1080
 
 
1081
1070
class RangeInChangeOption(BzrError):
1082
1071
 
1083
1072
    _fmt = "Option --change does not accept revision ranges"
1476
1465
        self.details = details
1477
1466
 
1478
1467
 
 
1468
class UnexpectedProtocolVersionMarker(TransportError):
 
1469
 
 
1470
    _fmt = "Received bad protocol version marker: %(marker)r"
 
1471
 
 
1472
    def __init__(self, marker):
 
1473
        self.marker = marker
 
1474
 
 
1475
 
1479
1476
class UnknownSmartMethod(InternalBzrError):
1480
1477
 
1481
1478
    _fmt = "The server does not recognise the '%(verb)s' request."
1484
1481
        self.verb = verb
1485
1482
 
1486
1483
 
 
1484
class SmartMessageHandlerError(InternalBzrError):
 
1485
 
 
1486
    _fmt = "The message handler raised an exception: %(exc_value)s."
 
1487
 
 
1488
    def __init__(self, exc_info):
 
1489
        self.exc_type, self.exc_value, self.tb = exc_info
 
1490
        
 
1491
 
1487
1492
# A set of semi-meaningful errors which can be thrown
1488
1493
class TransportNotPossible(TransportError):
1489
1494
 
2430
2435
        self.response_tuple = response_tuple
2431
2436
 
2432
2437
 
 
2438
class ErrorFromSmartServer(BzrError):
 
2439
 
 
2440
    _fmt = "Error received from smart server: %(error_tuple)r"
 
2441
 
 
2442
    internal_error = True
 
2443
 
 
2444
    def __init__(self, error_tuple):
 
2445
        self.error_tuple = error_tuple
 
2446
        try:
 
2447
            self.error_verb = error_tuple[0]
 
2448
        except IndexError:
 
2449
            self.error_verb = None
 
2450
        self.error_args = error_tuple[1:]
 
2451
 
 
2452
 
2433
2453
class ContainerError(BzrError):
2434
2454
    """Base class of container errors."""
2435
2455
 
2690
2710
        self.path = path
2691
2711
        self.kind = kind
2692
2712
        self.user_encoding = osutils.get_user_encoding()
 
2713
 
 
2714
 
 
2715
class CannotBindAddress(BzrError):
 
2716
 
 
2717
    _fmt = 'Cannot bind address "%(host)s:%(port)i": %(orig_error)s.'
 
2718
 
 
2719
    def __init__(self, host, port, orig_error):
 
2720
        BzrError.__init__(self, host=host, port=port,
 
2721
            orig_error=orig_error[1])