~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: John Arbash Meinel
  • Date: 2008-05-28 21:53:46 UTC
  • mfrom: (3453 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3458.
  • Revision ID: john@arbash-meinel.com-20080528215346-l8plys9h9ps624pn
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1465
1465
        self.details = details
1466
1466
 
1467
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
 
1468
1476
class UnknownSmartMethod(InternalBzrError):
1469
1477
 
1470
1478
    _fmt = "The server does not recognise the '%(verb)s' request."
1473
1481
        self.verb = verb
1474
1482
 
1475
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
 
1476
1492
# A set of semi-meaningful errors which can be thrown
1477
1493
class TransportNotPossible(TransportError):
1478
1494
 
2419
2435
        self.response_tuple = response_tuple
2420
2436
 
2421
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
 
2422
2453
class ContainerError(BzrError):
2423
2454
    """Base class of container errors."""
2424
2455