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.

Protocols

This functionality affects all supported protocols

Examples

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));
  }
}

Return value

A pointer to a null-terminated string.

Releases

11 releases since Debian 4.0 (Etch); the text changed 8 times.

  1. 4.0–5.0
  2. 6.0
  3. 7–8
  4. 9
  5. 10
  6. 11
  7. 12
  8. 13
  9. Arch

Availability

Added in curl 7.12.0

From curl 8.23.0-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.