catch some more exceptions
This commit is contained in:
parent
538d44549f
commit
6b37eeac01
1 changed files with 12 additions and 0 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue