diff options
author | James Hannah <jhannah@bytemark.co.uk> | 2017-07-11 12:49:49 +0100 |
---|---|---|
committer | James Hannah <jhannah@bytemark.co.uk> | 2017-07-11 12:49:49 +0100 |
commit | 3480fe810e83449516388176359429006ae1d8a0 (patch) | |
tree | 66262499db15b170edcbb131b2b85b9721520385 | |
parent | ebeb36d43a7dc204e59e25a344913eb8f5110959 (diff) | |
parent | 75e890bbd1e9bc5a6aba360d9660c9eda4cddcd1 (diff) |
Merge branch '13-log-dns-errors' into 'master'
Updated to log the exact DNS error.
See merge request !9
-rw-r--r-- | lib/custodian/protocoltest/http.rb | 10 |
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? |