cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: error codes that should really generate an exception...

From: Leo Huf Campos Braga <banvetor_at_gmail.com>
Date: Mon, 7 Nov 2005 20:35:48 -0200

Hi, I just forget to say that I'm only using the easy interface, so I
haven't included any share or multi errors. Maybe we should include
some of those if we were aiming at creating a complete list ?

Leo.

On 11/7/05, Leo Huf Campos Braga <banvetor_at_gmail.com> wrote:
> Hi...
> I'm writing a simple c++ class that performs some basic libcurl
> operations trough object oriented programming. When creating a
> CurlException class, I came accross the following dillema: many of the
> returned error codes are not really serious errors, most of them are
> just caused by a url typo, or a internet server down, something like
> that.
> Anyway, I was thinking of creating two classes, one that only gives
> a warning message, and another one that really generates an exception
> and terminates the program execution. I began reading trough all
> libcurl errors listed in the in the docs, and came with the following
> preliminary list of errors that should really terminate the program
> execution:
>
> CURLE_FAILED_INIT (2)
> CURLE_WRITE_ERROR (23)
> CURLE_READ_ERROR (26)
> CURLE_OUT_OF_MEMORY (27)
> CURLE_LDAP_CANNOT_BIND (38)
> CURLE_LDAP_SEARCH_FAILED (39)
> CURLE_LIBRARY_NOT_FOUND (40)
> CURLE_FUNCTION_NOT_FOUND (41)
> CURLE_ABORTED_BY_CALLBACK (42)
> CURLE_BAD_FUNCTION_ARGUMENT (43)
>
> The only problem is that, well, I really don't know libcurl errors
> very much, even because I just started working with it. For an
> example, I have no idea what LDAP is, and more or less selected all
> LDAP errors as exception generators. I have others doubts relating to,
> for an example, CURLE_SEND_ERROR (55) and CURLE_RECV_ERROR (56),
> because if this errors means that libcurl is not succeding in
> connecting to the internet, maybe it should really exit the program
> execution, as all other tries to connect to any other internet
> addresses will also fail.
> Well, I don't know if anyone has ever needed something like this or
> tried another solution? Any help would be very much appreciated :)
>
> Thanks
> Leo
>
Received on 2005-11-07