Minor cleanup

This commit is contained in:
Bob Polis 2024-03-31 14:46:41 +02:00
parent 8a7f92179d
commit 47d673e50a

View File

@ -43,7 +43,6 @@ requester& requester::operator=(requester&& other) {
} }
std::string requester::get(const std::string &url) { std::string requester::get(const std::string &url) {
_text = "";
curl_easy_setopt(_h.get(), CURLOPT_URL, url.c_str()); curl_easy_setopt(_h.get(), CURLOPT_URL, url.c_str());
perform(); perform();
check_status(200); check_status(200);
@ -79,7 +78,7 @@ void requester::check_status(long status) {
auto success = curl_easy_getinfo(_h.get(), CURLINFO_RESPONSE_CODE, &_status); auto success = curl_easy_getinfo(_h.get(), CURLINFO_RESPONSE_CODE, &_status);
if (success != CURLE_OK || _status != status) { if (success != CURLE_OK || _status != status) {
std::ostringstream oss; std::ostringstream oss;
oss << "could not get remote data (" << _status << ")"; oss << "unexpected status: " << _status;
throw std::runtime_error {oss.str()}; throw std::runtime_error {oss.str()};
} }
} }