/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: Canonical.com Patch Queue Manager
  • Date: 2007-07-03 05:24:58 UTC
  • mfrom: (2506.2.12 abentley-container-format)
  • Revision ID: pqm@pqm.ubuntu.com-20070703052458-wh36exfav0xnj9nf
(Andrew Bennetts, Aaron Bentley) Add container format as described in doc/developers/container-format.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
2150
2150
        self.response_tuple = response_tuple
2151
2151
 
2152
2152
 
 
2153
class ContainerError(BzrError):
 
2154
    """Base class of container errors."""
 
2155
 
 
2156
 
 
2157
class UnknownContainerFormatError(ContainerError):
 
2158
 
 
2159
    _fmt = "Unrecognised container format: %(container_format)r"
 
2160
    
 
2161
    def __init__(self, container_format):
 
2162
        self.container_format = container_format
 
2163
 
 
2164
 
 
2165
class UnexpectedEndOfContainerError(ContainerError):
 
2166
 
 
2167
    _fmt = "Unexpected end of container stream"
 
2168
 
 
2169
    internal_error = False
 
2170
 
 
2171
 
 
2172
class UnknownRecordTypeError(ContainerError):
 
2173
 
 
2174
    _fmt = "Unknown record type: %(record_type)r"
 
2175
 
 
2176
    def __init__(self, record_type):
 
2177
        self.record_type = record_type
 
2178
 
 
2179
 
 
2180
class InvalidRecordError(ContainerError):
 
2181
 
 
2182
    _fmt = "Invalid record: %(reason)s"
 
2183
 
 
2184
    def __init__(self, reason):
 
2185
        self.reason = reason
 
2186
 
 
2187
 
 
2188
class ContainerHasExcessDataError(ContainerError):
 
2189
 
 
2190
    _fmt = "Container has data after end marker: %(excess)r"
 
2191
 
 
2192
    def __init__(self, excess):
 
2193
        self.excess = excess
 
2194
 
 
2195
 
 
2196
class DuplicateRecordNameError(ContainerError):
 
2197
 
 
2198
    _fmt = "Container has multiple records with the same name: \"%(name)s\""
 
2199
 
 
2200
    def __init__(self, name):
 
2201
        self.name = name
 
2202
 
 
2203
 
2153
2204
class NoDestinationAddress(BzrError):
2154
2205
 
2155
2206
    _fmt = "Message does not have a destination address."