~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

Update to 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
 
2237
2253
            " Please set BZR_SSH environment variable.")
2238
2254
 
2239
2255
 
 
2256
class GhostRevisionsHaveNoRevno(BzrError):
 
2257
    """When searching for revnos, if we encounter a ghost, we are stuck"""
 
2258
 
 
2259
    _fmt = ("Could not determine revno for {%(revision_id)s} because"
 
2260
            " its ancestry shows a ghost at {%(ghost_revision_id)s}")
 
2261
 
 
2262
    def __init__(self, revision_id, ghost_revision_id):
 
2263
        self.revision_id = revision_id
 
2264
        self.ghost_revision_id = ghost_revision_id
 
2265
 
 
2266
        
2240
2267
class GhostRevisionUnusableHere(BzrError):
2241
2268
 
2242
2269
    _fmt = "Ghost revision {%(revision_id)s} cannot be used here."
2419
2446
        self.response_tuple = response_tuple
2420
2447
 
2421
2448
 
 
2449
class ErrorFromSmartServer(BzrError):
 
2450
 
 
2451
    _fmt = "Error received from smart server: %(error_tuple)r"
 
2452
 
 
2453
    internal_error = True
 
2454
 
 
2455
    def __init__(self, error_tuple):
 
2456
        self.error_tuple = error_tuple
 
2457
        try:
 
2458
            self.error_verb = error_tuple[0]
 
2459
        except IndexError:
 
2460
            self.error_verb = None
 
2461
        self.error_args = error_tuple[1:]
 
2462
 
 
2463
 
2422
2464
class ContainerError(BzrError):
2423
2465
    """Base class of container errors."""
2424
2466
 
2681
2723
        self.user_encoding = osutils.get_user_encoding()
2682
2724
 
2683
2725
 
 
2726
class NoSuchAlias(BzrError):
 
2727
 
 
2728
    _fmt = ('The alias "%(alias_name)s" does not exist.')
 
2729
 
 
2730
    def __init__(self, alias_name):
 
2731
        BzrError.__init__(self, alias_name=alias_name)
 
2732
 
 
2733
 
2684
2734
class CannotBindAddress(BzrError):
2685
2735
 
2686
2736
    _fmt = 'Cannot bind address "%(host)s:%(port)i": %(orig_error)s.'