Skip to content

Commit 33b81b2

Browse files
committed
Merge branch 'sp/remote-curl-ssl-strerror' into maint
Help those who debug http(s) part of the system. * sp/remote-curl-ssl-strerror: remote-curl: include curl_errorstr on SSL setup failures
2 parents 326e5bc + 0054045 commit 33b81b2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

remote-curl.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,20 @@ static int run_slot(struct active_request_slot *slot,
439439
err = run_one_slot(slot, results);
440440

441441
if (err != HTTP_OK && err != HTTP_REAUTH) {
442-
error("RPC failed; result=%d, HTTP code = %ld",
443-
results->curl_result, results->http_code);
442+
struct strbuf msg = STRBUF_INIT;
443+
if (results->http_code && results->http_code != 200)
444+
strbuf_addf(&msg, "HTTP %ld", results->http_code);
445+
if (results->curl_result != CURLE_OK) {
446+
if (msg.len)
447+
strbuf_addch(&msg, ' ');
448+
strbuf_addf(&msg, "curl %d", results->curl_result);
449+
if (curl_errorstr[0]) {
450+
strbuf_addch(&msg, ' ');
451+
strbuf_addstr(&msg, curl_errorstr);
452+
}
453+
}
454+
error("RPC failed; %s", msg.buf);
455+
strbuf_release(&msg);
444456
}
445457

446458
return err;

0 commit comments

Comments
 (0)