[Pkg-wmaker-commits] [wmbiff] 20/38: trap socket errors
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Thu Aug 20 03:03:39 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to tag wmbiff_0_4_16
in repository wmbiff.
commit 4928334772914aa8f5c7b11e7ab7bf4d15e00135
Author: bluehal <bluehal>
Date: Thu Apr 17 05:04:47 2003 +0000
trap socket errors
---
scripts/security.debian.rb | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/scripts/security.debian.rb b/scripts/security.debian.rb
index 726b296..a4ec0c2 100755
--- a/scripts/security.debian.rb
+++ b/scripts/security.debian.rb
@@ -110,9 +110,16 @@ packagelists.each { |urlpath, sc, uc|
session = Net::HTTP.new(Server)
# session.set_pipe($stderr);
end
- resp, data = session.get(urlpath,
- { 'If-Modified-Since' =>
- cached_time.strftime( "%a, %d %b %Y %H:%M:%S GMT" ) })
+ begin
+ resp, data = session.get(urlpath,
+ { 'If-Modified-Since' =>
+ cached_time.strftime( "%a, %d %b %Y %H:%M:%S GMT" ) })
+ rescue SocketError => e
+ # if the net is down, we'll get this error; avoid printing a stack trace.
+ puts "XX old"
+ puts e
+ exit 1;
+ end
test(?e, Cachedir) or Dir.mkdir(Cachedir)
File.open(uc, 'w') { |o| o.puts data }
test(?e, uc + '.stamp') and File.unlink(uc + '.stamp') # we have a copy, don't need the stamp.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbiff.git
More information about the Pkg-wmaker-commits
mailing list