curl_multi_strerror(3)

πŸ’… curl_multi_strerror β€” bestie's guide to the "what went wrong" translator

ok so like, this is curl_multi_strerror(3) from the Library Functions Manual β€” yes it's a whole manual page for one tiny little function, and honestly? iconic of it. πŸŽ€


✨ NAME ✨

curl_multi_strerror β€” return string describing error code

like, it takes a rude little numeric error code and hands you back an actual human sentence. the glow-up is real. πŸ¦‹


✨ SYNOPSIS ✨

#include <curl/curl.h>

const char *curl_multi_strerror(CURLMcode errornum);

one header, one function, zero drama. we love a low-maintenance icon. πŸ’œ


✨ DESCRIPTION ✨

okay so here's the whole vibe: this function returns a string describing the CURLMcode error code you pass in as the argument errornum. that's it. that's the function.

you give it a cryptic little number, it gives you back words. it's giving translator-bestie. it's giving "let me explain what he meant by that." 😭🫢

ngl the whole point is you don't have to memorise what each CURLMcode means β€” you just pass it in and print the string. chef's kiss. genuinely helpful and we stan. ✨


🌈 PROTOCOLS 🌈

This functionality affects all supported protocols

every single one. no protocol left behind. πŸ’… like, all of them, fr fr. πŸ‘‘


πŸ“ EXAMPLE πŸ“

ok so here's the actual code, and yes you can copy it exactly, I would never do you dirty like that:

int main(void)
{
  int still_running;
  CURLM *multi = curl_multi_init();

  CURLMcode mresult = curl_multi_perform(multi, &still_running);
  if(mresult)
    printf("error: %s\n", curl_multi_strerror(mresult));
}

see how it works? curl_multi_perform hands back a CURLMcode in mresult, and if that code is non-zero (i.e. something went sideways 😭), we just print the friendly string version. no cap, that's the whole pattern. 🧚


⭐ AVAILABILITY ⭐

Added in curl 7.12.0

so like, it's been around a minute. it's a legacy queen. πŸ‘‘ been serving since 7.12.0 and still going strong. πŸ”₯


πŸ’– RETURN VALUE πŸ’–

A pointer to a null-terminated string.

that's it. just a pointer to a string that ends in a null, like every well-behaved C string should. no allocation games, no surprises. main character energy but make it polite. πŸŽ€


πŸ¦‹ SEE ALSO πŸ¦‹


ok important: this page is about the multi interface specifically. if your error code came from a different handle type, use the matching *_strerror β€” don't be out here mismatching your error translators bestie, that's not the vibe. πŸ™ˆ

and that's the whole page!! written up for libcurl, dated 2026-10-12, pg curl_multi_strerror(3) β€” go forth and print your error strings, you're gonna slay πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from