Skip to content

Commit 20e5261

Browse files
committed
Print out HTTP error codes
1 parent db2647c commit 20e5261

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

modules/ggl-http/src/gghttp.c

+16
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ GglError fetch_token(
4646
error = gghttplib_process_request(&curl_data, buffer);
4747
}
4848

49+
long http_status_code = 0;
50+
curl_easy_getinfo(curl_data.curl, CURLINFO_HTTP_CODE, &http_status_code);
51+
GGL_LOGI("HTTP code: %ld", http_status_code);
52+
4953
gghttplib_destroy_curl(&curl_data);
5054

5155
return error;
@@ -60,6 +64,10 @@ GglError generic_download(const char *url_for_generic_download, int fd) {
6064
error = gghttplib_process_request_with_fd(&curl_data, fd);
6165
}
6266

67+
long http_status_code = 0;
68+
curl_easy_getinfo(curl_data.curl, CURLINFO_HTTP_CODE, &http_status_code);
69+
GGL_LOGD("Return HTTP code: %ld", http_status_code);
70+
6371
gghttplib_destroy_curl(&curl_data);
6472
return error;
6573
}
@@ -141,6 +149,10 @@ GglError sigv4_download(
141149
error = gghttplib_process_request_with_fd(&curl_data, fd);
142150
}
143151

152+
long http_status_code = 0;
153+
curl_easy_getinfo(curl_data.curl, CURLINFO_HTTP_CODE, &http_status_code);
154+
GGL_LOGD("Return HTTP code: %ld", http_status_code);
155+
144156
gghttplib_destroy_curl(&curl_data);
145157

146158
return error;
@@ -200,6 +212,10 @@ GglError gg_dataplane_call(
200212
ret = gghttplib_process_request(&curl_data, response_buffer);
201213
}
202214

215+
long http_status_code = 0;
216+
curl_easy_getinfo(curl_data.curl, CURLINFO_HTTP_CODE, &http_status_code);
217+
GGL_LOGI("HTTP code: %ld", http_status_code);
218+
203219
gghttplib_destroy_curl(&curl_data);
204220

205221
return ret;

0 commit comments

Comments
 (0)