|
|
@ -445,6 +445,10 @@ def fetch_url(module, url, data=None, headers=None, method=None,
|
|
|
|
except urllib2.URLError, e:
|
|
|
|
except urllib2.URLError, e:
|
|
|
|
code = int(getattr(e, 'code', -1))
|
|
|
|
code = int(getattr(e, 'code', -1))
|
|
|
|
info.update(dict(msg="Request failed: %s" % str(e), status=code))
|
|
|
|
info.update(dict(msg="Request failed: %s" % str(e), status=code))
|
|
|
|
|
|
|
|
except socket.error, e:
|
|
|
|
|
|
|
|
info.update(dict(msg="Connection failure: %s" % str(e), status=-1))
|
|
|
|
|
|
|
|
except Exception, e:
|
|
|
|
|
|
|
|
info.update(dict(msg="An unknown error occurred: %s" % str(e), status=-1))
|
|
|
|
|
|
|
|
|
|
|
|
return r, info
|
|
|
|
return r, info
|
|
|
|
|
|
|
|
|
|
|
|