curl\_easy\_strerror(3) Library Functions Manual curl\_easy\_strerror(3)

# [NAME](#NAME)

curl\_easy\_strerror - return string describing error code

# [SYNOPSIS](#SYNOPSIS)

```
#include <curl/curl.h>
const char *curl_easy_strerror(CURLcode errornum);
```

# [DESCRIPTION](#DESCRIPTION)

The [*curl\_easy\_strerror(3)*](/man/os/curl/curl_easy_strerror.3) function returns a string describing the CURLcode error code passed in the argument *errornum*.

Typically applications also appreciate [*CURLOPT\_ERRORBUFFER(3)*](/man/os/curl/CURLOPT_ERRORBUFFER.3) for more specific error descriptions generated at runtime.

# [PROTOCOLS](#PROTOCOLS)

This functionality affects all supported protocols

# [EXAMPLE](#EXAMPLE)

```
int main(void)
{


  CURL *curl = curl_easy_init();


  if(curl) {


    CURLcode result;


    /* set options */


    /* Perform the entire transfer */


    result = curl_easy_perform(curl);


    /* Check for errors */


    if(result != CURLE_OK)


      fprintf(stderr, "curl_easy_perform() failed: %s\n",


              curl_easy_strerror(result));


  }
}
```

# [AVAILABILITY](#AVAILABILITY)

Added in curl 7.12.0

# [RETURN VALUE](#RETURN_VALUE)

A pointer to a null-terminated string.

# [SEE ALSO](#SEE_ALSO)

[**curl\_multi\_strerror**(3)](/man/os/curl/curl_multi_strerror.3), [**curl\_share\_strerror**(3)](/man/os/curl/curl_share_strerror.3), [**curl\_url\_strerror**(3)](/man/os/curl/curl_url_strerror.3), [**libcurl-errors**(3)](/man/os/curl/libcurl-errors.3)

2026-10-14 libcurl

---

Document: curl_easy_strerror(3) from curl 8.23.0-r0 (Chainguard OS)
Source: https://github.com/curl/curl.git
