Commit 4ba5ebd1 by Brian Coca

Merge pull request #12538 from yesbox/url_lookup_plugin_httperror_fix

Fix url lookup plugin HTTPError message not being reachable
parents a1f6de87 353b549e
......@@ -36,10 +36,10 @@ class LookupModule(LookupBase):
self._display.vvvv("url lookup connecting to %s" % term)
try:
response = open_url(term, validate_certs=validate_certs)
except urllib2.URLError as e:
raise AnsibleError("Failed lookup url for %s : %s" % (term, str(e)))
except urllib2.HTTPError as e:
raise AnsibleError("Received HTTP error for %s : %s" % (term, str(e)))
except urllib2.URLError as e:
raise AnsibleError("Failed lookup url for %s : %s" % (term, str(e)))
except SSLValidationError as e:
raise AnsibleError("Error validating the server's certificate for %s: %s" % (term, str(e)))
except ConnectionError as e:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment