curl_easy_strerror.3 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. .\" generated by cd2nroff 0.1 from curl_easy_strerror.md
  2. .TH curl_easy_strerror 3 "2025-01-17" libcurl
  3. .SH NAME
  4. curl_easy_strerror \- return string describing error code
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. const char *curl_easy_strerror(CURLcode errornum);
  9. .fi
  10. .SH DESCRIPTION
  11. The \fIcurl_easy_strerror(3)\fP function returns a string describing the
  12. CURLcode error code passed in the argument \fIerrornum\fP.
  13. Typically applications also appreciate \fICURLOPT_ERRORBUFFER(3)\fP for more
  14. specific error descriptions generated at runtime.
  15. .SH PROTOCOLS
  16. This functionality affects all supported protocols
  17. .SH EXAMPLE
  18. .nf
  19. int main(void)
  20. {
  21. CURL *curl = curl_easy_init();
  22. if(curl) {
  23. CURLcode res;
  24. /* set options */
  25. /* Perform the entire transfer */
  26. res = curl_easy_perform(curl);
  27. /* Check for errors */
  28. if(res != CURLE_OK)
  29. fprintf(stderr, "curl_easy_perform() failed: %s\\n",
  30. curl_easy_strerror(res));
  31. }
  32. }
  33. .fi
  34. .SH AVAILABILITY
  35. Added in curl 7.12.0
  36. .SH RETURN VALUE
  37. A pointer to a null\-terminated string.
  38. .SH SEE ALSO
  39. .BR curl_multi_strerror (3),
  40. .BR curl_share_strerror (3),
  41. .BR curl_url_strerror (3),
  42. .BR libcurl-errors (3)