still better error handling

This commit is contained in:
Ward Wouts 2002-07-04 22:40:24 +00:00
parent 8a31948d36
commit 06600fc0d4
3 changed files with 8 additions and 5 deletions

View file

@ -1,6 +1,10 @@
# $Id$
# $Source$
from 0.0.6 to 0.0.7
- use exceptions for a lot of problems
- code cleanups
from 0.0.5 to 0.0.6
- new option -C for combined filenames eg. "subject-[filename]"
- prevent reconnect loops

View file

@ -188,7 +188,7 @@ def get_xhdr(server, range, header)
end
unless resp.to_i >= 200 and resp.to_i < 300
print "got response #{resp} while reading group #{@group} from #{server}\n"
raise XhdrError
raise TempError
end
rescue Net::NNTP::RuntimeError
print "Caught Net::NNTP::RuntimeError reading from server #{server}\n"
@ -785,9 +785,7 @@ def _ydecode_file(file, outfile)
if b.to_i == oldpartend + 1
oldpartend = e.to_i
else
print "Parts not continuous! last end #{oldpartend}, begin #{b}\n"
print "Bailing out...\n"
return false
raise PermError, "Parts not continuous! last end #{oldpartend}, begin #{b}\n"
end
next
end

View file

@ -327,7 +327,8 @@ for group in @config.keys.sort
mode, filename, body = get_multi(i, group)
end
output_data(i, mode, filename, body) if mode != false
rescue Article::TempError
rescue Article::TempError, Article::PermError
print "#{$!}\n"
print "Skipping article...\n"
next
end