From 6b37eeac01aa885e3589ae67363586118c94329f Mon Sep 17 00:00:00 2001 From: Ward Wouts Date: Tue, 14 May 2002 20:08:53 +0000 Subject: [PATCH] catch some more exceptions --- trunk/ripnews/news/article.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/trunk/ripnews/news/article.rb b/trunk/ripnews/news/article.rb index cdd6f5c..e924f15 100644 --- a/trunk/ripnews/news/article.rb +++ b/trunk/ripnews/news/article.rb @@ -62,6 +62,11 @@ def get_articles(cachedir=false) rescue Net::NNTP::RuntimeError print "Couldn't open group: #{@group}\n" return false + rescue Errno::EPIPE, Errno::ECONNRESET + print "Caught Errno::EPIPE reading from server #{server}\n" + print "Error: #{$!}\n" + reconnect(server) + retry end end read_cache(cachedir) @@ -104,6 +109,11 @@ def get_articles(cachedir=false) end end rescue Net::NNTP::RuntimeError + rescue Errno::EPIPE, Errno::ECONNRESET + print "Caught Errno::EPIPE reading from server #{server}\n" + print "Error: #{$!}\n" + reconnect(server) + retry end end end @@ -155,6 +165,7 @@ def get_group_body(subj) resp, id, messid, list = @connections[@groups[subj]["servers"][i]]["nntp"].body(@groups[subj]["messages"][i]) rescue Net::NNTPReplyError print "Caught Net::NNTPReplyError in get_group_body reading article #{@groups[subj]["messages"][0]}\n" + print "Error: #{$!}\n" print "mess-id i: #{@groups[subj]["messages"][i]}\n" print "mess-id i+1: #{@groups[subj]["messages"][i+1]}\n" if (i+1 < @groups[subj]["messages"].length) and @@ -192,6 +203,7 @@ def get_group_body_first(subj) resp, id, messid, list = @connections[@groups[subj]["servers"][i]]["nntp"].body(@groups[subj]["messages"][i]) rescue Net::NNTPReplyError print "Caught Net::NNTPReplyError in get_group_body_first reading article #{@groups[subj]["messages"][0]}\n" + print "Error: #{$!}\n" if (i+1 < @groups[subj]["messages"].length) and (@groups[subj]["messages"][i] == @groups[subj]["messages"][i+1]) print "Trying next server...\n"