/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: Andrew Bennetts
  • Date: 2008-11-27 09:00:45 UTC
  • mfrom: (3865 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3866.
  • Revision ID: andrew.bennetts@canonical.com-20081127090045-qxatg46jzwrbh2lg
Merge bzr.dev, resolving NEWS conflict.  (And improve the wording of the new NEWS entry too.)

Show diffs side-by-side

added added

removed removed

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