Name: libURLErrorData

Type: function

Syntax: libURLErrorData(<url>)

Summary: <return|Returns> any error that was caused during a <download> that was started with the <load> <command>.

Introduced: 1.1.1

OS: mac,windows,linux

Platforms: desktop,server,web

Security: network

Example:
put libURLErrorData("http://www.example.org/index.html") into myErr

Example:
if libURLErrorData(it) contains "404" then answer "File doesn't exist!"

Example:
if libURLStatus(myURL) is "error" then return libURLErrorData(myURL)

Parameters:
url: A URL, or an expression that evaluates to a URL.

The result: You can check the <URLStatus> <function> to determine the status of a <URL> that has been <cache|cached> with the <load> <command>. If the <download> encountered an error, the <URLStatus> <function> returns "error". In this case, the <libURLErrorData> <function> returns the result of the attempted <download>.

Returns: The <libURLErrorData> <function> <return|returns> a string.

Description:
Use the <libURLErrorData> <function> to check the error status of a <download>.

If the download failed because of a server error--for example, if a requested web page was not found--the <libURLErrorData> <function> returns the error message sent by the <server>. If the <download> failed for another reason--for example, if the <server> did not respond, or if an invalid <URL> was supplied--the <libURLErrorData> <function> returns an error message generated by the <Internet library>.

>*Important:*  The <libURLErrorData> <function> is part of the <Internet library>. To ensure that the <command> works in a <standalone application>, you must include this <Revolution custom library|custom library> when you create your <standalone application|standalone>. In the Inclusions section of the <Standalone Application Settings> window, make sure "Internet Library" is selected in the list of script libraries.

References: https (keyword), ftp (keyword), URL (keyword), http (keyword), Internet library (library), Revolution custom library (library), libURLSetLogField (command), load (command), libURLErrorData (function), cachedURLs (function), URLStatus (function), return (glossary), Standalone Application Settings (glossary), download (glossary), cache (glossary), standalone application (glossary), command (glossary), server (glossary), function (control_st)

Tags: networking
