urlapi: add curl_url_strerror()

Add curl_url_strerror() to convert CURLUcode into readable string and
facilitate easier troubleshooting in programs using URL API.
Extend CURLUcode with CURLU_LAST for iteration in unit tests.
Update man pages with a mention of new function.
Update example code and tests with new functionality where it fits.

Closes #7605
This commit is contained in:
i-ky 2021-09-27 08:22:54 +02:00 committed by Daniel Stenberg
parent f0b8d1c5f6
commit 3363eeb262
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
25 changed files with 233 additions and 72 deletions

View file

@ -325,6 +325,8 @@ Not enough memory was available.
The requested sharing could not be done because the library you use don't have
that particular feature enabled. (Added in 7.23.0)
.SH "CURLUcode"
The URL interface will return a CURLUcode to indicate when an error has
occurred. Also consider \fIcurl_url_strerror(3)\fP.
.IP "CURLUE_BAD_HANDLE (1)"
An invalid CURLU pointer was passed as argument.
.IP "CURLUE_BAD_PARTPOINTER (2)"
@ -361,5 +363,6 @@ There is no query part in the URL.
There is no fragment part in the URL.
.SH "SEE ALSO"
.BR curl_easy_strerror "(3), " curl_multi_strerror "(3), "
.BR curl_share_strerror "(3), " CURLOPT_ERRORBUFFER "(3), "
.BR CURLOPT_VERBOSE "(3), " CURLOPT_DEBUGFUNCTION "(3) "
.BR curl_share_strerror "(3), " curl_url_strerror "(3), "
.BR CURLOPT_ERRORBUFFER "(3), " CURLOPT_VERBOSE "(3), "
.BR CURLOPT_DEBUGFUNCTION "(3)"