File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -52,9 +52,18 @@ class SimpleCurlGet {
5252 }
5353 }
5454
55- curl_easy_setopt (curl, CURLOPT_URL, url.c_str ());
56- curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, &write_data);
57- curl_easy_setopt (curl, CURLOPT_WRITEDATA, this );
55+ CURLcode rv = curl_easy_setopt (curl, CURLOPT_URL, url.c_str ());
56+ if (rv != CURLE_OK) {
57+ throw CurlException (" Failed to set CURLOPT_URL." );
58+ }
59+ rv = curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, &write_data);
60+ if (rv != CURLE_OK) {
61+ throw CurlException (" Failed to set CURLOPT_WRITEFUNCTION." );
62+ }
63+ rv = curl_easy_setopt (curl, CURLOPT_WRITEDATA, this );
64+ if (rv != CURLE_OK) {
65+ throw CurlException (" Failed to set CURLOPT_WRITEDATA." );
66+ }
5867
5968 auto res = curl_easy_perform (curl);
6069 if (res != CURLE_OK) {
You can’t perform that action at this time.
0 commit comments