summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2017-07-11 12:37:20 +0300
committerSteve Kemp <steve@steve.org.uk>2017-07-11 12:37:20 +0300
commit75e890bbd1e9bc5a6aba360d9660c9eda4cddcd1 (patch)
tree66262499db15b170edcbb131b2b85b9721520385
parentebeb36d43a7dc204e59e25a344913eb8f5110959 (diff)
Updated to log the exact DNS error.13-log-dns-errors
This is part of #13.
-rw-r--r--lib/custodian/protocoltest/http.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/custodian/protocoltest/http.rb b/lib/custodian/protocoltest/http.rb
index dfd8ee4..67b4660 100644
--- a/lib/custodian/protocoltest/http.rb
+++ b/lib/custodian/protocoltest/http.rb
@@ -336,9 +336,9 @@ module Custodian
errors << "#{protocol_msg}: Connection failed."
rescue Curl::Err::TooManyRedirectsError
errors << "#{protocol_msg}: More than 10 redirections."
- rescue Curl::Err::HostResolutionError
- # Nothing to see here..!
- resolution_errors << resolve_mode
+ rescue Curl::Err::HostResolutionError => x
+ # Log the DNS error-message.
+ resolution_errors << "#{resolve_mode} - #{x.message}"
rescue => x
errors << "#{protocol_msg}: #{x.class}: #{x.message}\n #{x.backtrace.join("\n ")}."
end
@@ -359,8 +359,8 @@ module Custodian
end
# uh-oh! Resolution failed on both protocols!
- if resolution_errors.length > 1
- errors << "Hostname did not resolve for #{resolution_errors.join(', ')}"
+ if resolution_errors.length > 0
+ errors << "DNS Error when resolving host - #{resolution_errors.join(',')}"
end
if !errors.empty?