Barry Warsaw | c5f8fe3 | 2001-09-26 22:21:52 +0000 | [diff] [blame] | 1 | \declaremodule{standard}{email.Errors} |
Barry Warsaw | 5e63463 | 2001-09-26 05:23:47 +0000 | [diff] [blame] | 2 | \modulesynopsis{The exception classes used by the email package.} |
Barry Warsaw | 5e63463 | 2001-09-26 05:23:47 +0000 | [diff] [blame] | 3 | |
| 4 | The following exception classes are defined in the |
| 5 | \module{email.Errors} module: |
| 6 | |
| 7 | \begin{excclassdesc}{MessageError}{} |
| 8 | This is the base class for all exceptions that the \module{email} |
| 9 | package can raise. It is derived from the standard |
| 10 | \exception{Exception} class and defines no additional methods. |
| 11 | \end{excclassdesc} |
| 12 | |
| 13 | \begin{excclassdesc}{MessageParseError}{} |
| 14 | This is the base class for exceptions thrown by the \class{Parser} |
| 15 | class. It is derived from \exception{MessageError}. |
| 16 | \end{excclassdesc} |
| 17 | |
| 18 | \begin{excclassdesc}{HeaderParseError}{} |
| 19 | Raised under some error conditions when parsing the \rfc{2822} headers of |
| 20 | a message, this class is derived from \exception{MessageParseError}. |
| 21 | It can be raised from the \method{Parser.parse()} or |
| 22 | \method{Parser.parsestr()} methods. |
| 23 | |
| 24 | Situations where it can be raised include finding a \emph{Unix-From} |
| 25 | header after the first \rfc{2822} header of the message, finding a |
| 26 | continuation line before the first \rfc{2822} header is found, or finding |
| 27 | a line in the headers which is neither a header or a continuation |
| 28 | line. |
| 29 | \end{excclassdesc} |
| 30 | |
| 31 | \begin{excclassdesc}{BoundaryError}{} |
| 32 | Raised under some error conditions when parsing the \rfc{2822} headers of |
| 33 | a message, this class is derived from \exception{MessageParseError}. |
| 34 | It can be raised from the \method{Parser.parse()} or |
| 35 | \method{Parser.parsestr()} methods. |
| 36 | |
| 37 | Situations where it can be raised include not being able to find the |
Barry Warsaw | c5f8fe3 | 2001-09-26 22:21:52 +0000 | [diff] [blame] | 38 | starting or terminating boundary in a \mimetype{multipart/*} message. |
Barry Warsaw | 5e63463 | 2001-09-26 05:23:47 +0000 | [diff] [blame] | 39 | \end{excclassdesc} |
| 40 | |
| 41 | \begin{excclassdesc}{MultipartConversionError}{} |
| 42 | Raised when a payload is added to a \class{Message} object using |
| 43 | \method{add_payload()}, but the payload is already a scalar and the |
Barry Warsaw | c5f8fe3 | 2001-09-26 22:21:52 +0000 | [diff] [blame] | 44 | message's \mailheader{Content-Type} main type is not either |
| 45 | \mimetype{multipart} or missing. \exception{MultipartConversionError} |
| 46 | multiply inherits from \exception{MessageError} and the built-in |
| 47 | \exception{TypeError}. |
Barry Warsaw | 5e63463 | 2001-09-26 05:23:47 +0000 | [diff] [blame] | 48 | \end{excclassdesc} |