/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-21 02:59:20 UTC
  • mfrom: (3441 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3445.
  • Revision ID: mbp@sourcefrog.net-20080521025920-90v48vtksrcdksjk
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."
1453
1465
        self.details = details
1454
1466
 
1455
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
 
1456
1476
class UnknownSmartMethod(InternalBzrError):
1457
1477
 
1458
1478
    _fmt = "The server does not recognise the '%(verb)s' request."
1461
1481
        self.verb = verb
1462
1482
 
1463
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
 
1464
1492
# A set of semi-meaningful errors which can be thrown
1465
1493
class TransportNotPossible(TransportError):
1466
1494
 
2407
2435
        self.response_tuple = response_tuple
2408
2436
 
2409
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
 
2410
2453
class ContainerError(BzrError):
2411
2454
    """Base class of container errors."""
2412
2455