summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-13 17:05:17 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-13 17:05:17 +0000
commita977d57759bbe20ae6a6eff6ef1af29a6b7ff936 (patch)
tree892002d54c308e639ec4a6d88aa3d1aa2e1410a7
parentd7f71acfaec1dc28b703fec1d81e0d1976360567 (diff)
Handle connection-refused.
-rwxr-xr-xworker/tests/http.rb3
-rwxr-xr-xworker/tests/https.rb3
2 files changed, 6 insertions, 0 deletions
diff --git a/worker/tests/http.rb b/worker/tests/http.rb
index 3988606..0d4cdd3 100755
--- a/worker/tests/http.rb
+++ b/worker/tests/http.rb
@@ -138,6 +138,9 @@ class HTTPTest
rescue Timeout::Error => ex
@error = "time out reached"
return false
+ rescue Errno::ECONNREFUSED => ex
+ @error = "Connection refused"
+ return false
rescue => ex
raise ex
return false
diff --git a/worker/tests/https.rb b/worker/tests/https.rb
index f0e4f4c..49cdcef 100755
--- a/worker/tests/https.rb
+++ b/worker/tests/https.rb
@@ -139,6 +139,9 @@ class HTTPSTest
rescue Timeout::Error => ex
@error = "time out reached"
return false
+ rescue Errno::ECONNREFUSED => ex
+ @error = "Connection refused"
+ return false
rescue => ex
raise ex
return false