/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Ā fromĀ remote-transport

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
183
183
        self.branch = branch
184
184
 
185
185
 
 
186
class InventoryModified(BzrNewError):
 
187
    """The current inventory for the tree %(tree)r has been modified, so a clean inventory cannot be read without data loss."""
 
188
 
 
189
    def __init__(self, tree):
 
190
        BzrNewError.__init__(self)
 
191
        self.tree = tree
 
192
 
 
193
 
186
194
class NoSuchId(BzrNewError):
187
195
    """The file id %(file_id)s is not present in the tree %(tree)s."""
188
196
    
212
220
        self.url = url
213
221
 
214
222
 
 
223
class NotWriteLocked(BzrNewError):
 
224
    """%(not_locked)r is not write locked but needs to be."""
 
225
 
 
226
    def __init__(self, not_locked):
 
227
        BzrNewError.__init__(self)
 
228
        self.not_locked = not_locked
 
229
 
 
230
 
215
231
class BzrCommandError(BzrNewError):
216
232
    """Error from user command"""
217
233
 
858
874
    """Connection error: %(msg)s %(orig_error)s"""
859
875
 
860
876
 
 
877
class SocketConnectionError(ConnectionError):
 
878
    """%(msg)s %(host)s%(port)s%(orig_error)s"""
 
879
 
 
880
    def __init__(self, host, port=None, msg=None, orig_error=None):
 
881
        if msg is None:
 
882
            msg = 'Failed to connect to'
 
883
        if orig_error is None:
 
884
            orig_error = ''
 
885
        else:
 
886
            orig_error = '; ' + str(orig_error)
 
887
        ConnectionError.__init__(self, msg=msg, orig_error=orig_error)
 
888
        self.host = host
 
889
        if port is None:
 
890
            self.port = ''
 
891
        else:
 
892
            self.port = ':%s' % port
 
893
 
 
894
 
861
895
class ConnectionReset(TransportError):
862
896
    """Connection closed: %(msg)s %(orig_error)s"""
863
897
 
1020
1054
    """Tree transform is malformed %(conflicts)r"""
1021
1055
 
1022
1056
 
 
1057
class NoFinalPath(BzrNewError):
 
1058
    """No final name for trans_id %(trans_id)r
 
1059
    file-id: %(file_id)r"
 
1060
    root trans-id: %(root_trans_id)r 
 
1061
    """
 
1062
 
 
1063
    def __init__(self, trans_id, transform):
 
1064
        self.trans_id = trans_id
 
1065
        self.file_id = transform.final_file_id(trans_id)
 
1066
        self.root_trans_id = transform.root
 
1067
 
 
1068
 
1023
1069
class BzrBadParameter(BzrNewError):
1024
1070
    """A bad parameter : %(param)s is not usable.
1025
1071