We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3849bb6 commit 38e58faCopy full SHA for 38e58fa
src/scitokens_internal.cpp
@@ -52,9 +52,18 @@ class SimpleCurlGet {
52
}
53
54
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);
+ CURLcode rv = curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
+ if (rv != CURLE_OK) {
+ throw CurlException("Failed to set CURLOPT_URL.");
58
+ }
59
+ rv = curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &write_data);
60
61
+ throw CurlException("Failed to set CURLOPT_WRITEFUNCTION.");
62
63
+ rv = curl_easy_setopt(curl, CURLOPT_WRITEDATA, this);
64
65
+ throw CurlException("Failed to set CURLOPT_WRITEDATA.");
66
67
68
auto res = curl_easy_perform(curl);
69
if (res != CURLE_OK) {
0 commit comments