/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 trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
    Base class for errors raised by bzrlib.
55
55
 
56
56
    :cvar internal_error: if True this was probably caused by a bzr bug and
57
 
    should be displayed with a traceback; if False (or absent) this was
58
 
    probably a user or environment error and they don't need the gory details.
59
 
    (That can be overridden by -Derror on the command line.)
 
57
        should be displayed with a traceback; if False (or absent) this was
 
58
        probably a user or environment error and they don't need the gory
 
59
        details.  (That can be overridden by -Derror on the command line.)
60
60
 
61
61
    :cvar _fmt: Format string to display the error; this is expanded
62
 
    by the instance's dict.
 
62
        by the instance's dict.
63
63
    """
64
64
 
65
65
    internal_error = False
304
304
class RootMissing(InternalBzrError):
305
305
 
306
306
    _fmt = ("The root entry of a tree must be the first entry supplied to "
307
 
        "record_entry_contents.")
 
307
        "the commit builder.")
308
308
 
309
309
 
310
310
class NoPublicBranch(BzrError):
864
864
        """Construct a new AlreadyVersionedError.
865
865
 
866
866
        :param path: This is the path which is versioned,
867
 
        which should be in a user friendly form.
 
867
            which should be in a user friendly form.
868
868
        :param context_info: If given, this is information about the context,
869
 
        which could explain why this is expected to not be versioned.
 
869
            which could explain why this is expected to not be versioned.
870
870
        """
871
871
        BzrError.__init__(self)
872
872
        self.path = path
885
885
        """Construct a new NotVersionedError.
886
886
 
887
887
        :param path: This is the path which is not versioned,
888
 
        which should be in a user friendly form.
 
888
            which should be in a user friendly form.
889
889
        :param context_info: If given, this is information about the context,
890
 
        which could explain why this is expected to be versioned.
 
890
            which could explain why this is expected to be versioned.
891
891
        """
892
892
        BzrError.__init__(self)
893
893
        self.path = path
1715
1715
 
1716
1716
class InvalidHttpResponse(TransportError):
1717
1717
 
1718
 
    _fmt = "Invalid http response for %(path)s: %(msg)s"
 
1718
    _fmt = "Invalid http response for %(path)s: %(msg)s%(orig_error)s"
1719
1719
 
1720
1720
    def __init__(self, path, msg, orig_error=None):
1721
1721
        self.path = path
 
1722
        if orig_error is None:
 
1723
            orig_error = ''
 
1724
        else:
 
1725
            # This is reached for obscure and unusual errors so we want to
 
1726
            # preserve as much info as possible to ease debug.
 
1727
            orig_error = ': %r' % (orig_error,)
1722
1728
        TransportError.__init__(self, msg, orig_error=orig_error)
1723
1729
 
1724
1730
 
2665
2671
 
2666
2672
    This is distinct from ErrorFromSmartServer so that it is possible to
2667
2673
    distinguish between the following two cases:
2668
 
      - ErrorFromSmartServer was uncaught.  This is logic error in the client
2669
 
        and so should provoke a traceback to the user.
2670
 
      - ErrorFromSmartServer was caught but its error_tuple could not be
2671
 
        translated.  This is probably because the server sent us garbage, and
2672
 
        should not provoke a traceback.
 
2674
 
 
2675
    - ErrorFromSmartServer was uncaught.  This is logic error in the client
 
2676
      and so should provoke a traceback to the user.
 
2677
    - ErrorFromSmartServer was caught but its error_tuple could not be
 
2678
      translated.  This is probably because the server sent us garbage, and
 
2679
      should not provoke a traceback.
2673
2680
    """
2674
2681
 
2675
2682
    _fmt = "Server sent an unexpected error: %(error_tuple)r"