node-curl icon indicating copy to clipboard operation
node-curl copied to clipboard

CURL Error codes

Open ccarlin opened this issue 11 years ago • 1 comments

How can you get the error code from CURL when an error occurs. All I seem to be able to see is a free text error message like: "Couldn't resolve host name" which doesn't even match the libcurl error codes text for that particular error:

CURLE_COULDNT_RESOLVE_HOST (6) Couldn't resolve host. The given remote host was not resolved.

How can I get the coded value or the matching text from the curl.on(error', function(e) {}); method?

ccarlin avatar Aug 19 '13 20:08 ccarlin

Error code is not supported in current version. The error code is converted to error message by curl_easy_strerror.

jiangmiao avatar Aug 20 '13 08:08 jiangmiao