Skip to content

Commit 744f44a

Browse files
committed
cURL catch for perform loses scope
1 parent 64c9b70 commit 744f44a

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

libs/openFrameworks/utils/ofURLFileLoader.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -399,20 +399,12 @@ ofHttpResponse ofURLFileLoaderImpl::handleRequest(const ofHttpRequest & request)
399399
ofFile saveTo(request.name, ofFile::WriteOnly, true);
400400
curl_easy_setopt(curl.get(), CURLOPT_WRITEDATA, &saveTo);
401401
curl_easy_setopt(curl.get(), CURLOPT_WRITEFUNCTION, saveToFile_cb);
402+
err = curl_easy_perform(curl.get());
402403
} else {
403404
curl_easy_setopt(curl.get(), CURLOPT_WRITEDATA, &response);
404405
curl_easy_setopt(curl.get(), CURLOPT_WRITEFUNCTION, saveToMemory_cb);
405-
}
406-
try {
407406
err = curl_easy_perform(curl.get());
408-
} catch (const std::exception & e) {
409-
ofLogError("ofURLFileLoader") << "Exception: " << e.what();
410-
return ofHttpResponse(request, -1, e.what());
411-
} catch (...) {
412-
ofLogError("ofURLFileLoader") << "Unknown exception caught!";
413-
return ofHttpResponse(request, -1, "Unknown exception");
414407
}
415-
416408
if (err == CURLE_OK) {
417409
long http_code = 0;
418410
curl_easy_getinfo(curl.get(), CURLINFO_RESPONSE_CODE, &http_code);

0 commit comments

Comments
 (0)