/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: Canonical.com Patch Queue Manager
  • Date: 2008-09-06 10:25:39 UTC
  • mfrom: (3690.1.2 nicer-error)
  • Revision ID: pqm@pqm.ubuntu.com-20080906102539-ss1fkx2csdcalqlc
Do not traceback on unexpected error responses from a smart server.
        (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2508
2508
 
2509
2509
 
2510
2510
class ErrorFromSmartServer(BzrError):
 
2511
    """An error was received from a smart server.
 
2512
 
 
2513
    :seealso: UnknownErrorFromSmartServer
 
2514
    """
2511
2515
 
2512
2516
    _fmt = "Error received from smart server: %(error_tuple)r"
2513
2517
 
2522
2526
        self.error_args = error_tuple[1:]
2523
2527
 
2524
2528
 
 
2529
class UnknownErrorFromSmartServer(BzrError):
 
2530
    """An ErrorFromSmartServer could not be translated into a typical bzrlib
 
2531
    error.
 
2532
 
 
2533
    This is distinct from ErrorFromSmartServer so that it is possible to
 
2534
    distinguish between the following two cases:
 
2535
      - ErrorFromSmartServer was uncaught.  This is logic error in the client
 
2536
        and so should provoke a traceback to the user.
 
2537
      - ErrorFromSmartServer was caught but its error_tuple could not be
 
2538
        translated.  This is probably because the server sent us garbage, and
 
2539
        should not provoke a traceback.
 
2540
    """
 
2541
 
 
2542
    _fmt = "Server sent an unexpected error: %(error_tuple)r"
 
2543
 
 
2544
    internal_error = False
 
2545
 
 
2546
    def __init__(self, error_from_smart_server):
 
2547
        """Constructor.
 
2548
 
 
2549
        :param error_from_smart_server: An ErrorFromSmartServer instance.
 
2550
        """
 
2551
        self.error_from_smart_server = error_from_smart_server
 
2552
        self.error_tuple = error_from_smart_server.error_tuple
 
2553
        
 
2554
 
2525
2555
class ContainerError(BzrError):
2526
2556
    """Base class of container errors."""
2527
2557