/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: Aaron Bentley
  • Date: 2007-07-03 18:00:34 UTC
  • mfrom: (2577 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2578.
  • Revision ID: abentley@panoramicfeedback.com-20070703180034-zuiuqbo5mx0tsa1n
Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
186
186
        self.class_name = class_name
187
187
 
188
188
 
 
189
class IncompatibleAPI(BzrError):
 
190
 
 
191
    _fmt = 'The API for "%(api)s" is not compatible with "%(wanted)s". '\
 
192
        'It supports versions "%(minimum)s" to "%(current)s".'
 
193
 
 
194
    def __init__(self, api, wanted, minimum, current):
 
195
        self.api = api
 
196
        self.wanted = wanted
 
197
        self.minimum = minimum
 
198
        self.current = current
 
199
 
 
200
 
189
201
class InvalidEntryName(BzrError):
190
202
    
191
203
    _fmt = "Invalid entry name: %(name)s"
1579
1591
 
1580
1592
    _fmt = "Bad parameter: %(param)r"
1581
1593
 
 
1594
    internal_error = True
 
1595
 
1582
1596
    # This exception should never be thrown, but it is a base class for all
1583
1597
    # parameter-to-function errors.
1584
1598
 
2134
2148
 
2135
2149
    def __init__(self, response_tuple):
2136
2150
        self.response_tuple = response_tuple
 
2151
 
 
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
 
 
2204
class NoDestinationAddress(BzrError):
 
2205
 
 
2206
    _fmt = "Message does not have a destination address."
 
2207
 
 
2208
    internal_error = True
 
2209
 
 
2210
 
 
2211
class SMTPError(BzrError):
 
2212
 
 
2213
    _fmt = "SMTP error: %(error)s"
 
2214
 
 
2215
    def __init__(self, error):
 
2216
        self.error = error