From: wmorgan Date: Thu, 4 Jan 2007 06:16:24 +0000 (+0000) Subject: sometimes rmail fails, apparently? X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=a96e3781cdc815da5fad94cf2fcc1abe099cc0e2;p=sup sometimes rmail fails, apparently? git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@171 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- diff --git a/lib/sup/message.rb b/lib/sup/message.rb index fe98794..41f3834 100644 --- a/lib/sup/message.rb +++ b/lib/sup/message.rb @@ -179,7 +179,7 @@ class Message begin # read_header @source.load_header(@source_info) ##XXXX is this ok? message_to_chunks @source.load_message(@source_info) - rescue SourceError, SocketError => e + rescue SourceError, SocketError, MessageFormatError => e [Text.new(error_message(e.message))] end end @@ -246,9 +246,7 @@ private ret = [] << case m.header.content_type when "text/plain", nil - raise MessageFormatError, "no message body before decode (source #@source info #@source_info)" unless - m.body - body = m.decode or raise MessageFormatError, "no message body" + m.body && body = m.decode or raise MessageFormatError, "for some bizarre reason, RubyMail was unable to parse this message." text_to_chunks body.normalize_whitespace.split("\n") when /^multipart\// nil