Modules/cURL/curl strerror

From Multi Theft Auto: Wiki
Revision as of 11:12, 22 June 2014 by DutchCaffeine (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Package-x-generic.png This function is provided by the external module cURL. You must install this module to use this function.

Returns a string with detailed information of an error.

Syntax

curlStrerror(curl handler, CURLcode code)

Required arguments

  • curl The curl handler
  • code The curl code

Returns

The string containing the error, if the code was not found in the system it will return nil

Example

curl = curlInit();
if not curl then
    outputDebugString("Can't connect to http://mtasa.com/ with cURL");
else
    curlSetopt(curl, CURLOPT_URL, curlEscape(curl, "http://mtasa.com/"));
    result = curlPerform(curl);
    print(curlStrerror(curl, result)); -- Since we know that mta exists, we sure get the text 'No error.'
    curlClose(curl);
end


See also