summaryrefslogtreecommitdiff
path: root/lib/feed2imap
diff options
context:
space:
mode:
authorlnu <lnu@f70e237a-67f3-0310-a06c-d2b8a7116972>2007-10-03 19:17:27 +0000
committerlnu <lnu@f70e237a-67f3-0310-a06c-d2b8a7116972>2007-10-03 19:17:27 +0000
commite227f88983ccdaa923c00e10ff5031d3b17330df (patch)
tree62981a08308e2e2e2960ecc490f26ffaa92e2c32 /lib/feed2imap
parent1f69eada4b2f9badd0413540d1cd42b7ab1604eb (diff)
downloadfeed2imap-e227f88983ccdaa923c00e10ff5031d3b17330df.tar.gz
feed2imap-e227f88983ccdaa923c00e10ff5031d3b17330df.tar.bz2
feed2imap-e227f88983ccdaa923c00e10ff5031d3b17330df.zip
exit when we receice an IMAP error
git-svn-id: svn+ssh://svn.gna.org/svn/feed2imap/trunk/feed2imap@136 f70e237a-67f3-0310-a06c-d2b8a7116972
Diffstat (limited to '')
-rw-r--r--lib/feed2imap/feed2imap.rb11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/feed2imap/feed2imap.rb b/lib/feed2imap/feed2imap.rb
index 08ceb4f..9a59432 100644
--- a/lib/feed2imap/feed2imap.rb
+++ b/lib/feed2imap/feed2imap.rb
@@ -187,7 +187,6 @@ class Feed2Imap
ths.each { |t| t.join }
@logger.info("Parsing and uploading ...")
@config.feeds.each do |f|
- everything_ok = true
if f.body.nil? # means 304
@logger.debug("Feed #{f.name} did not change.")
next
@@ -228,15 +227,11 @@ class Feed2Imap
rescue
@logger.fatal("Exception caught while uploading mail to #{f.folder}: #{$!}")
puts $!.backtrace
- everything_ok = false
- next
+ @logger.fatal("We can't recover from IMAP errors, so we are exiting.")
+ exit(1)
end
begin
- if everything_ok
- @cache.commit_cache(f.name)
- else
- @logger.fatal("Not updating cache for #{f.name} because something went wrong earlier.")
- end
+ @cache.commit_cache(f.name)
rescue
@logger.fatal("Exception caught while updating cache for #{f.name}: #{$!}")
next