350
350
# XXX: Should be unified with TransportError; they seem to represent the
352
# RBC 20060929: I think that unifiying with TransportError would be a mistake
353
# - this is finer than a TransportError - and more useful as such. It
354
# differentiates between 'transport has failed' and 'operation on a transport
352
356
class PathError(BzrError):
354
358
_fmt = "Generic path error: %(path)r%(extra)s)"
457
461
PathError.__init__(self, url, extra=extra)
464
class ReadError(PathError):
466
_fmt = """Error reading from %(path)r."""
460
469
class ShortReadvError(PathError):
462
471
_fmt = ("readv() read %(actual)s bytes rather than %(length)s bytes"
2150
2159
self.response_tuple = response_tuple
2162
class ContainerError(BzrError):
2163
"""Base class of container errors."""
2166
class UnknownContainerFormatError(ContainerError):
2168
_fmt = "Unrecognised container format: %(container_format)r"
2170
def __init__(self, container_format):
2171
self.container_format = container_format
2174
class UnexpectedEndOfContainerError(ContainerError):
2176
_fmt = "Unexpected end of container stream"
2178
internal_error = False
2181
class UnknownRecordTypeError(ContainerError):
2183
_fmt = "Unknown record type: %(record_type)r"
2185
def __init__(self, record_type):
2186
self.record_type = record_type
2189
class InvalidRecordError(ContainerError):
2191
_fmt = "Invalid record: %(reason)s"
2193
def __init__(self, reason):
2194
self.reason = reason
2197
class ContainerHasExcessDataError(ContainerError):
2199
_fmt = "Container has data after end marker: %(excess)r"
2201
def __init__(self, excess):
2202
self.excess = excess
2205
class DuplicateRecordNameError(ContainerError):
2207
_fmt = "Container has multiple records with the same name: \"%(name)s\""
2209
def __init__(self, name):
2153
2213
class NoDestinationAddress(BzrError):
2155
2215
_fmt = "Message does not have a destination address."