File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,13 @@ namespace {
165
165
curl_easy_setopt (h, CURLOPT_PROTOCOLS_STR, " https" );
166
166
CURLcode res = curl_easy_perform (h);
167
167
168
- sua::Logger::debug (" curl_easy_perform ended with code = '{}'" , res);
168
+ const auto curl_status_message = fmt::format (" curl_easy_perform ended with code = {} ({})" , res, curl_easy_strerror (res));
169
+
170
+ if (res == CURLE_OK) {
171
+ sua::Logger::trace (curl_status_message);
172
+ } else {
173
+ sua::Logger::error (curl_status_message);
174
+ }
169
175
170
176
long http_code = 0 ;
171
177
curl_easy_getinfo (h, CURLINFO_RESPONSE_CODE, &http_code);
@@ -174,9 +180,7 @@ namespace {
174
180
175
181
sua::Logger::debug (" CURLINFO_RESPONSE_CODE = {}" , http_code);
176
182
if (http_code != 200 ) {
177
- auto e = curl_easy_strerror (res);
178
- sua::Logger::error (e);
179
- return std::make_tuple (sua::TechCode::DownloadFailed, e);
183
+ return std::make_tuple (sua::TechCode::DownloadFailed, curl_easy_strerror (res));
180
184
}
181
185
182
186
return std::make_tuple (sua::TechCode::OK, " " );
You can’t perform that action at this time.
0 commit comments