]> git.cworth.org Git - sup/commitdiff
sometimes rmail fails, apparently?
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Thu, 4 Jan 2007 06:16:24 +0000 (06:16 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Thu, 4 Jan 2007 06:16:24 +0000 (06:16 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@171 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/message.rb

index fe987944745e6ebc22916b912c9dd3147350f89c..41f3834e614b73440500ab8af72c0bc0088a65cb 100644 (file)
@@ -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