0001 # Copyright (C) 2001-2004 Python Software Foundation 0002 # Author: Barry Warsaw 0003 # Contact: email-sig@python.org 0004 0005 """email package exception classes.""" 0006 0007 0008 0009 class MessageError(Exception): 0010 """Base class for errors in the email package.""" 0011 0012 0013 class MessageParseError(MessageError): 0014 """Base class for message parsing errors.""" 0015 0016 0017 class HeaderParseError(MessageParseError): 0018 """Error while parsing headers.""" 0019 0020 0021 class BoundaryError(MessageParseError): 0022 """Couldn't find terminating boundary.""" 0023 0024 0025 class MultipartConversionError(MessageError, TypeError): 0026 """Conversion to a multipart is prohibited.""" 0027 0028 0029 0030 # These are parsing defects which the parser was able to work around. 0031 class MessageDefect: 0032 """Base class for a message defect.""" 0033 0034 def __init__(self, line=None): 0035 self.line = line 0036 0037 class NoBoundaryInMultipartDefect(MessageDefect): 0038 """A message claimed to be a multipart but had no boundary parameter.""" 0039 0040 class StartBoundaryNotFoundDefect(MessageDefect): 0041 """The claimed start boundary was never found.""" 0042 0043 class FirstHeaderLineIsContinuationDefect(MessageDefect): 0044 """A message had a continuation line as its first header line.""" 0045 0046 class MisplacedEnvelopeHeaderDefect(MessageDefect): 0047 """A 'Unix-from' header was found in the middle of a header block.""" 0048 0049 class MalformedHeaderDefect(MessageDefect): 0050 """Found a header that was missing a colon, or was otherwise malformed.""" 0051 0052 class MultipartInvariantViolationDefect(MessageDefect): 0053 """A message claimed to be a multipart but no subparts were found.""" 0054
Generated by PyXR 0.9.4