curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder Daniel himself.

Re: Error Handling Feedback

From: vigorous-neatness--- via curl-library <curl-library_at_lists.haxx.se>
Date: Sat, 7 Mar 2026 22:07:32 -0600

Hi Andrew,

You can use CURLOPT_ERRORBUFFER (https://curl.se/libcurl/c/CURLOPT_ERRORBUFFER.html) before sending the request to get more information. You should also probably be taking a look at the response code from your curl_easy_perform call - it likely contains information on the failure type if it failed. Your curl_easy_getinfo, I presume, is simply checking the HTTP code - where there is none if an http request never actually occurred.

> On Mar 6, 2026, at 15:43, Andrew Bell via curl-library <noreply-vigorous-neatness_at_oantby.com> wrote:
>
> Oantby Info:
>
> Original From: Andrew Bell via curl-library <curl-library_at_lists.haxx.se>
> Original To: curl-library_at_lists.haxx.se
> Cc: Andrew Bell <andrew.bell.ia_at_gmail.com>,curl-library_at_lists.haxx.se
> Hi,
>
> I was having an occasional failure of my application and when I turned on debug I got the following:
>
> * upload completely sent off: 16 bytes
> * connect to 127.0.0.1 port 8080 from 127.0.0.1 port 59936 failed: Connection reset by peer
> * Failed to connect to 127.0.0.1 port 8080 after 4 ms: Could not connect to server
> * closing connection #5
>
> I am getting a zero(0) code from my HTTP get request when I call curl_easy_getinfo(), but it would be nice to be able to get the "connection reset by peer" information. Is there a way to fetch such detailed feedback?
>
> Thanks,
>
> --
> Andrew Bell
> ### Original To: curl-library_at_lists.haxx.se
> ### Cc: Andrew Bell <andrew.bell.ia_at_gmail.com>,curl-library_at_lists.haxx.se
>
> --
> Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
> Etiquette: https://curl.se/mail/etiquette.html


-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2026-03-08