"email.errors": 例外及び欠陥クラス
**********************************

"email.errors" モジュールでは、以下の例外クラスが定義されています:

exception email.errors.MessageError

   これは "email" パッケージが送出しうるすべての例外の基底クラスです。
   これは標準の "Exception" クラスから派生しており、追加のメソッドは定
   義されていません。

exception email.errors.MessageParseError

   This is the base class for exceptions raised by the "Parser" class.
   It is derived from "MessageError".

exception email.errors.HeaderParseError

   Raised under some error conditions when parsing the **RFC 2822**
   headers of a message, this class is derived from
   "MessageParseError". It can be raised from the "Parser.parse" or
   "Parser.parsestr" methods.

   Situations where it can be raised include finding an envelope
   header after the first **RFC 2822** header of the message, finding
   a continuation line before the first **RFC 2822** header is found,
   or finding a line in the headers which is neither a header or a
   continuation line.

exception email.errors.BoundaryError

   Raised under some error conditions when parsing the **RFC 2822**
   headers of a message, this class is derived from
   "MessageParseError". It can be raised from the "Parser.parse" or
   "Parser.parsestr" methods.

   Situations where it can be raised include not being able to find
   the starting or terminating boundary in a *multipart/** message
   when strict parsing is used.

exception email.errors.MultipartConversionError

   この例外は、 "Message" オブジェクトに "add_payload()" メソッドでペ
   イロードを追加したが、そのペイロードがすでにスカラー値で、メッセー
   ジの *Content-Type* メインタイプが *multipart* でないか見付からない
   場合に送出されます。 "MultipartConversionError" は "MessageError"
   と組み込みの "TypeError" を多重継承しています。

   "Message.add_payload()" は非推奨なので、実際のところこの例外が送出
   されることはほとんどありません。 しかしながら、 "attach()" メソッド
   を "MIMENonMultipart" から派生したインスタンス (たとえば
   "MIMEImage") に対して呼んだ場合にも送出されることがあります。

Here’s the list of the defects that the "FeedParser" can find while
parsing messages.  Note that the defects are added to the message
where the problem was found, so for example, if a message nested
inside a *multipart/alternative* had a malformed header, that nested
message object would have a defect, but the containing messages would
not.

All defect classes are subclassed from "email.errors.MessageDefect",
but this class is *not* an exception!

バージョン 2.4 で追加: All the defect classes were added.

* "NoBoundaryInMultipartDefect" – メッセージが multipart だと宣言さ
  れ ているのに、 *boundary* パラメータがありません。

* "StartBoundaryNotFoundDefect" – *Content-Type* ヘッダで宣言された
  開 始境界がありません。

* "FirstHeaderLineIsContinuationDefect" – メッセージの最初のヘッダ行
  が 継続行です。

* "MisplacedEnvelopeHeaderDefect" – ヘッダブロックの途中に 「Unix
  From 」 ヘッダがあります。

* "MalformedHeaderDefect" – ヘッダにコロンがありません、あるいはそれ
  以 外の不正な形式です。

* "MultipartInvariantViolationDefect" – メッセージが *multipart* だ
  と 宣言されているのに、サブパートが存在しません。 メッセージがこの欠
  陥 を持つ場合、内容の型が *multipart* と宣言されていても
  "is_multipart()" メソッドは偽を返すことがあるので注意してください。
