diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2013-08-26 05:18:19 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2013-08-26 05:18:19 +0000 |
commit | 96f1562808fc5d2f0598c453de70b25f02ab462f (patch) | |
tree | 4df0c34183a1d66599f7be2d34f18bce98cce10b /sca-cpp | |
parent | 64587892afe11d985e2afdfc3a0e71cd8e96c18d (diff) |
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
Diffstat (limited to 'sca-cpp')
-rw-r--r-- | sca-cpp/trunk/modules/http/curl-get.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sca-cpp/trunk/modules/http/curl-get.cpp b/sca-cpp/trunk/modules/http/curl-get.cpp index 983dd20fc5..96efcc7897 100644 --- a/sca-cpp/trunk/modules/http/curl-get.cpp +++ b/sca-cpp/trunk/modules/http/curl-get.cpp @@ -35,8 +35,10 @@ namespace http { const bool testGet(const string& url, const string& ca = "", const string& cert = "", const string& key = "") { const CURLSession ch(ca, cert, key, "", 0); const failable<value> val = get(url, ch); - assert(hasContent(val)); - cout << content(val) << endl; + if(!hasContent(val)) + cerr << reason(val) << endl; + else + cout << content(val) << endl; return true; } |