/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

merge bzr.dev@3883

Show diffs side-by-side

added added

removed removed

Lines of Context:
1485
1485
        self.options = options
1486
1486
 
1487
1487
 
 
1488
class RetryWithNewPacks(BzrError):
 
1489
    """Raised when we realize that the packs on disk have changed.
 
1490
 
 
1491
    This is meant as more of a signaling exception, to trap between where a
 
1492
    local error occurred and the code that can actually handle the error and
 
1493
    code that can retry appropriately.
 
1494
    """
 
1495
 
 
1496
    internal_error = True
 
1497
 
 
1498
    _fmt = ("Pack files have changed, reload and retry. %(orig_error)s")
 
1499
 
 
1500
    def __init__(self, reload_occurred, exc_info):
 
1501
        """create a new RestartWithNewPacks error.
 
1502
 
 
1503
        :param reload_occurred: Set to True if we know that the packs have
 
1504
            already been reloaded, and we are failing because of an in-memory
 
1505
            cache miss. If set to True then we will ignore if a reload says
 
1506
            nothing has changed, because we assume it has already reloaded. If
 
1507
            False, then a reload with nothing changed will force an error.
 
1508
        :param exc_info: The original exception traceback, so if there is a
 
1509
            problem we can raise the original error (value from sys.exc_info())
 
1510
        """
 
1511
        BzrError.__init__(self)
 
1512
        self.reload_occurred = reload_occurred
 
1513
        self.exc_info = exc_info
 
1514
        self.orig_error = exc_info[1]
 
1515
        # TODO: The global error handler should probably treat this by
 
1516
        #       raising/printing the original exception with a bit about
 
1517
        #       RetryWithNewPacks also not being caught
 
1518
 
 
1519
 
1488
1520
class NoSuchExportFormat(BzrError):
1489
1521
    
1490
1522
    _fmt = "Export format %(format)r not supported"