From: wmorgan Date: Wed, 14 Feb 2007 01:42:17 +0000 (+0000) Subject: fixed imap each throwing uncaught sourceerror X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=1cb0b3071eea8a456a1cff56d8fa33b738937770;p=sup fixed imap each throwing uncaught sourceerror git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@328 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- diff --git a/lib/sup/poll.rb b/lib/sup/poll.rb index 03e0c9f..6a17409 100644 --- a/lib/sup/poll.rb +++ b/lib/sup/poll.rb @@ -83,15 +83,15 @@ class PollManager def add_new_messages_from source return if source.done? || source.broken? - source.each do |offset, labels| - if source.broken? - Redwood::log "error loading messages from #{source}: #{source.broken_msg}" - return - end + begin + source.each do |offset, labels| + if source.broken? + Redwood::log "error loading messages from #{source}: #{source.broken_msg}" + return + end - labels.each { |l| LabelManager << l } + labels.each { |l| LabelManager << l } - begin m = Message.new :source => source, :source_info => offset, :labels => labels if m.source_marked_read? m.remove_label :unread @@ -107,9 +107,9 @@ class PollManager Index.add_message m UpdateManager.relay self, :add, m end - rescue MessageFormatError, SourceError => e - Redwood::log "ignoring erroneous message at #{source}##{offset}: #{e.message}" end + rescue MessageFormatError, SourceError => e + Redwood::log "found problem with #{source}: #{e.message}" end end end