commit 6f420efa81de57beadb6f0e858d36d32f2c98323
parent ae6ea277be4c1e77b90e3152c870698c2e827043
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date: Wed, 7 Nov 2007 20:19:04 +0000
fix normalize_whitespace error where rubymail is breaking
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@677 5c8cc53c-5e98-4d25-b20a-d8db53a31250
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/sup/message.rb b/lib/sup/message.rb
@@ -361,11 +361,11 @@ private
end
def self.convert_from body, charset
- return body unless charset
-
begin
+ raise MessageFormatError, "RubyMail decode returned a null body" unless body
+ return body unless charset
Iconv.iconv($encoding, charset, body).join
- rescue Errno::EINVAL, Iconv::InvalidEncoding, Iconv::IllegalSequence => e
+ rescue Errno::EINVAL, Iconv::InvalidEncoding, Iconv::IllegalSequence, MessageFormatError => e
Redwood::log "warning: error (#{e.class.name}) decoding message body from #{charset}: #{e.message}"
File.open("sup-unable-to-decode.txt", "w") { |f| f.write body }
body