curl_easy_strerror(3)

curl_easy_strerror3

Return string describing error code

Usage

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

Overview

The 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) for more specific error descriptions generated at runtime.

Examples

int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    CURLcode res;
    /* set options */
    /* Perform the entire transfer */
    res = curl_easy_perform(curl);
    /* Check for errors */
    if(res != CURLE_OK)
      fprintf(stderr, "curl_easy_perform() failed: %s\n",
              curl_easy_strerror(res));
  }
}

Return value

A pointer to a null-terminated string.

Releases

135 releases since Mac OS X 10.4; the text changed 18 times.

  1. 10.4–10.4.11
  2. 10.5–10.6.2
  3. 10.6.3–10.6.8
  4. 10.7–10.7.5
  5. 10.8–10.10.4
  6. 10.10.5–10.11.6
  7. 10.12–10.12.5
  8. 10.12.6–10.14.6
  9. 10.15–11.5
  10. 12.0.1–12.2
  11. 12.3–12.5
  12. 13.0
  13. 13.1
  14. 13.2
  15. 13.3
  16. 13.4
  17. 13.5–14.1
  18. 14.2–14.4
  19. 14.5–26.5

Availability

This function was added in libcurl 7.12.0

From curl 166.0.0.0.1 in macOS 26.5. Parsed by carta from the page's man source.