138
138
self.not_ancestor_id = not_ancestor_id
141
class NotAncestor(BzrError):
142
def __init__(self, rev_id, not_ancestor_id):
144
self.not_ancestor_id = not_ancestor_id
145
msg = "Revision %s is not an ancestor of %s" % (not_ancestor_id,
147
BzrError.__init__(self, msg)
141
150
class InstallFailed(BzrError):
142
151
def __init__(self, revisions):
143
152
msg = "Could not install revisions:\n%s" % " ,".join(revisions)
169
178
from bzrlib.weave import WeaveError
180
class TransportError(BzrError):
181
"""All errors thrown by Transport implementations should derive
184
def __init__(self, msg=None, orig_error=None):
185
if msg is None and orig_error is not None:
186
msg = str(orig_error)
187
BzrError.__init__(self, msg)
189
self.orig_error = orig_error
191
# A set of semi-meaningful errors which can be thrown
192
class TransportNotPossible(TransportError):
193
"""This is for transports where a specific function is explicitly not
194
possible. Such as pushing files to an HTTP server.
198
class NonRelativePath(TransportError):
199
"""An absolute path was supplied, that could not be decoded into
204
class NoSuchFile(TransportError, IOError):
205
"""A get() was issued for a file that doesn't exist."""
206
def __init__(self, msg=None, orig_error=None):
208
TransportError.__init__(self, msg=msg, orig_error=orig_error)
209
IOError.__init__(self, errno.ENOENT, self.msg)
211
class FileExists(TransportError, OSError):
212
"""An operation was attempted, which would overwrite an entry,
213
but overwritting is not supported.
215
mkdir() can throw this, but put() just overwites existing files.
217
def __init__(self, msg=None, orig_error=None):
219
TransportError.__init__(self, msg=msg, orig_error=orig_error)
220
OSError.__init__(self, errno.EEXIST, self.msg)
222
class PermissionDenied(TransportError):
223
"""An operation cannot succeed because of a lack of permissions."""
226
class ConnectionReset(TransportError):
227
"""The connection has been closed."""