src/core_services/serviceregistry.cpp
/**
 * @brief  Perform a libcurl request and throw exception if an error occurs
 *
 * @param[in]  ctx  Context for the request
 *
 * @throw  TransportError if libcurl signals an error
 * @throw  TransportError if the HTTP response code is not 200
 */
@brief  Perform a libcurl request and throw exception if an error occurs
@param[in]  ctx  Context for the request

@throw  TransportError if libcurl signals an error
@throw  TransportError if the HTTP response code is not 200
@brief Perform a libcurl request and throw exception if an error occurs @param [ in ] ctx Context for the request @throw TransportError if libcurl signals an error @throw TransportError if the HTTP response code is not 200
void libcurl_perform_checked_throw(HTTP::CURLContext& ctx)
{
    CURLcode curl_code = curl_easy_perform(ctx.curl);
    if (curl_code != CURLE_OK) {
        std::ostringstream ss;
        ss << "CURLError " << curl_code <<
            ": " << curl_easy_strerror(curl_code) <<
            ", " << ctx.errbuf;
        throw TransportError(ss.str());
    }
    long http_code = 0;
    curl_easy_getinfo (ctx.curl, CURLINFO_RESPONSE_CODE, &http_code);
    if ((http_code < 200) || (http_code >= 299))
    {
        std::ostringstream ss;
        ss << "HTTPError " << http_code;
        throw TransportError(ss.str());
    }
}
void libcurl_perform_checked_throw ( HTTP :: CURLContext & ctx ) { CURLcode curl_code = curl_easy_perform ( ctx . curl ) ; if ( curl_code != CURLE_OK ) { std :: ostringstream ss ; ss << " " << curl_code << " " << curl_easy_strerror ( curl_code ) << " " << ctx . errbuf ; throw TransportError ( ss . str ( ) ) ; } long http_code = 0 ; curl_easy_getinfo ( ctx . curl , CURLINFO_RESPONSE_CODE , & http_code ) ; if ( ( http_code < 200 ) || ( http_code >= 299 ) ) { std :: ostringstream ss ; ss << " " << http_code ; throw TransportError ( ss . str ( ) ) ; } }
@brief  Perform a libcurl request and throw exception if an error occurs
 @param[in]  ctx  Context for the request
@brief Perform a libcurl request and throw exception if an error occurs @param [ in ] ctx Context for the request
/* Perform the request */ /* Check for errors */ /* Fail */