Change curl-get utility to display error message instead of aborting on error.

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1517424 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
jsdelfino 2013-08-26 05:18:19 +00:00
parent 64587892af
commit 96f1562808

View file

@ -35,8 +35,10 @@ namespace http {
const bool testGet(const string& url, const string& ca = "", const string& cert = "", const string& key = "") { const bool testGet(const string& url, const string& ca = "", const string& cert = "", const string& key = "") {
const CURLSession ch(ca, cert, key, "", 0); const CURLSession ch(ca, cert, key, "", 0);
const failable<value> val = get(url, ch); const failable<value> val = get(url, ch);
assert(hasContent(val)); if(!hasContent(val))
cout << content(val) << endl; cerr << reason(val) << endl;
else
cout << content(val) << endl;
return true; return true;
} }