Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

CURL.ErrorCode

Returns the last CURL error code.

Component Version macOS Windows Linux Server iOS SDK
CURL 2.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "CURL.ErrorCode"; curl )   More

Parameters

Parameter Description Example
curl The CURL session handle. $curl

Result

The last error code from CURL.

Description

Returns the last CURL error code.

Typical error codes are 6 for a wrong domain name in the URL, 67 for wrong name/password combination, 60 for missing SSL settings, 1 for an unsupported protocol.

The list of possible error codes:

NameNumberDescription
CURLE_OK0No error.
CURLE_UNSUPPORTED_PROTOCOL1Unsupported protocol.
CURLE_FAILED_INIT2Initialization failed or option not available.
CURLE_URL_MALFORMAT3URL has wrong format.
CURLE_COULDNT_RESOLVE_PROXY5DNS didn't return proxy IP.
CURLE_COULDNT_RESOLVE_HOST6DNS didn't return IP for host.
CURLE_COULDNT_CONNECT7Connection failed.
CURLE_FTP_WEIRD_SERVER_REPLY8FTP error.
CURLE_REMOTE_ACCESS_DENIED9A service was denied by the server due to lack of access when login fails this is not returned.
CURLE_FTP_WEIRD_PASS_REPLY11FTP error.
CURLE_FTP_WEIRD_PASV_REPLY13FTP error.
CURLE_FTP_WEIRD_227_FORMAT14FTP error.
CURLE_FTP_CANT_GET_HOST15FTP error.
CURLE_FTP_COULDNT_SET_TYPE17FTP set command failed.
CURLE_PARTIAL_FILE18Only a part of the file was downloaded.
CURLE_FTP_COULDNT_RETR_FILE19File not found.
CURLE_QUOTE_ERROR21quote command failure
CURLE_HTTP_RETURNED_ERROR22HTTP returned an error.
CURLE_WRITE_ERROR23Write error.
CURLE_UPLOAD_FAILED25failed upload "command"
CURLE_READ_ERROR26couldn't open/read from file
CURLE_OUT_OF_MEMORY27Out Of memory
CURLE_OPERATION_TIMEDOUT28the timeout time was reached
CURLE_FTP_PORT_FAILED30FTP PORT operation failed
CURLE_FTP_COULDNT_USE_REST31the REST command failed
CURLE_RANGE_ERROR33RANGE "command" didn't work
CURLE_HTTP_POST_ERROR34HTTP Post failed.
CURLE_SSL_CONNECT_ERROR35wrong when connecting with SSL
CURLE_BAD_DOWNLOAD_RESUME36couldn't resume download
CURLE_FILE_COULDNT_READ_FILE37Failed to read file.
CURLE_LDAP_CANNOT_BIND38LDAP can't connect.
CURLE_LDAP_SEARCH_FAILED39LDAP Search failed.
CURLE_FUNCTION_NOT_FOUND41Function not found.
CURLE_ABORTED_BY_CALLBACK42Transfer aborted with CURL.Cancel.
CURLE_BAD_FUNCTION_ARGUMENT43Bad parameters.
CURLE_INTERFACE_FAILED45CURL.OptionInterface failed
CURLE_TOO_MANY_REDIRECTS 47catch endless re-direct loops
CURLE_UNKNOWN_TELNET_OPTION48User specified an unknown option
CURLE_TELNET_OPTION_SYNTAX 49Malformed telnet option
CURLE_PEER_FAILED_VERIFICATION51peer's certificate or fingerprint wasn't verified fine
CURLE_GOT_NOTHING52when this is a specific error
CURLE_SSL_ENGINE_NOTFOUND53SSL crypto engine not found
CURLE_SSL_ENGINE_SETFAILED54can not set SSL crypto engine as default
CURLE_SEND_ERROR55failed sending network data
CURLE_RECV_ERROR56failure in receiving network data
CURLE_SSL_CERTPROBLEM58problem with the local certificate
CURLE_SSL_CIPHER59couldn't use specified cipher
CURLE_SSL_CACERT60problem with the CA cert (path?)
CURLE_BAD_CONTENT_ENCODING61Unrecognized transfer encoding
CURLE_LDAP_INVALID_URL62Invalid LDAP URL
CURLE_FILESIZE_EXCEEDED63Maximum file size exceeded
CURLE_USE_SSL_FAILED64Requested FTP SSL level failed
CURLE_SEND_FAIL_REWIND65Sending the data requires a rewind that failed
CURLE_SSL_ENGINE_INITFAILED66failed to initialise ENGINE
CURLE_LOGIN_DENIED67user, password or similar was not accepted and we failed to login
CURLE_TFTP_NOTFOUND68file not found on server
CURLE_TFTP_PERM69permission problem on server
CURLE_REMOTE_DISK_FULL70out of disk space on server
CURLE_TFTP_ILLEGAL71Illegal TFTP operation
CURLE_TFTP_UNKNOWNID72Unknown transfer ID
CURLE_REMOTE_FILE_EXISTS73File already exists
CURLE_TFTP_NOSUCHUSER74No such user
CURLE_CONV_FAILED75conversion failed
CURLE_CONV_REQD76caller must register conversion callbacks
CURLE_SSL_CACERT_BADFILE77could not load CACERT file, missing or wrong format
CURLE_REMOTE_FILE_NOT_FOUND78remote file not found
CURLE_SSH79error from the SSH layer, somewhat generic so the error message will be of interest when this has happened
CURLE_SSL_SHUTDOWN_FAILED80Failed to shut down the SSL connection
CURLE_AGAIN81socket is not ready for send/recv, wait till it's ready and try again.
CURLE_SSL_CRL_BADFILE82could not load CRL file, missing or wrong format.
CURLE_SSL_ISSUER_ERROR83Issuer check failed.
CURLE_FTP_PRET_FAILED84a PRET command failed
CURLE_RTSP_CSEQ_ERROR85mismatch of RTSP CSeq numbers
CURLE_RTSP_SESSION_ERROR86mismatch of RTSP Session Identifiers
CURLE_FTP_BAD_FILE_LIST87unable to parse FTP file list
CURLE_CHUNK_FAILED88chunk callback reported error

Examples

On success puts download in container, else shows failed:

Set Variable [$errorCode; Value:MBS("CURL.ErrorCode"; $curl)]
Set Variable [$httpResult; Value:MBS("CURL.GetResponseCode"; $curl)]
Set Field [Download Async::Result; $errorCode]
Set Field [Download Async::DebugMessages; MBS("CURL.GetDebugMessages"; $curl)]
If [$errorCode = 0 and $httpResult = 200]
    Set Field [Download Async::Progress; "Done"]
    Set Field [Download Async::Output; MBS("CURL.GetResultAsContainer"; $curl)]
Else
    Set Field [Download Async::Progress; "Failed"]
    Set Field [Download Async::Output; ""]
End If

See also

Example Databases

Blog Entries

This function checks for a license.

Created 18th August 2014, last changed 3th January 2023


CURL.CreateOutputFile - CURL.ErrorMessage