<doc>
  <legacy_id>1669</legacy_id>
  <name>libURLErrorData</name>
  <type>function</type>
  <syntax>
    <example>libURLErrorData(<i>url</i>)</example>
  </syntax>
  <library>Internet library</library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Networks &amp; Communication</category>
    <category>Standalone Applications</category>
  </classification>
  <references>
    <function tag="cachedURLs">cachedURLs Function</function>
    <keyword tag="ftp">ftp Keyword</keyword>
    <keyword tag="http">http Keyword</keyword>
    <command tag="libURLSetLogField">libURLSetLogField Command</command>
    <command tag="load">load Command</command>
    <function tag="URLStatus">URLStatus Function</function>
    <keyword tag="https">https Keyword</keyword>
  </references>
  <history>
    <introduced version="1.1.1">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
  </classes>
  <security>
    <network/>
  </security>
  <summary><glossary tag="return">Returns</glossary> any error that was caused during a <glossary tag="download">download</glossary> that was started with the <command tag="load">load</command> <glossary tag="command">command</glossary>.</summary>
  <examples>
    <example>put libURLErrorData("http://www.example.org/index.html") into myErr</example>
    <example>if libURLErrorData(it) contains "404" then answer "File doesn't exist!"</example>
    <example>if libURLStatus(myURL) is "error" then return libURLErrorData(myURL)</example>
  </examples>
  <description>
    <p>Use the <b>libURLErrorData</b> <control_st tag="function">function</control_st> to check the error status of a <glossary tag="download">download</glossary>.</p><p/><p><b>Parameters:</b></p><p>The <i>url</i> is a <keyword tag="URL">URL</keyword>, or an <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a <keyword tag="URL">URL</keyword>.</p><p/><p><b>Value:</b></p><p>The <b>libURLErrorData</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> a string.</p><p/><p><b>Comments:</b></p><p>You can check the <b>URLStatus</b> <control_st tag="function">function</control_st> to determine the status of a <keyword tag="URL">URL</keyword> that has been <glossary tag="cache">cached</glossary> with the <command tag="load">load</command> <glossary tag="command">command</glossary>. If the <glossary tag="download">download</glossary> encountered an error, the <b>URLStatus</b> <control_st tag="function">function</control_st> returns "error". In this case, the <function tag="libURLErrorData">libURLErrorData</function> <control_st tag="function">function</control_st> returns the result of the attempted <glossary tag="download">download</glossary>.</p><p/><p>If the download failed because of a server error--for example, if a requested web page was not found--the <b>libURLErrorData</b> <control_st tag="function">function</control_st> returns the error message sent by the <glossary tag="server">server</glossary>. If the <glossary tag="download">download</glossary> failed for another reason--for example, if the <glossary tag="server">server</glossary> did not respond, or if an invalid <keyword tag="URL">URL</keyword> was supplied--the <b>libURLErrorData</b> <control_st tag="function">function</control_st> returns an error message generated by the <glossary tag="Internet library">Internet library</glossary>.</p><p/><p><code/><img src="202653"/> <b>Important!</b><code/> The <b>libURLErrorData</b> <control_st tag="function">function</control_st> is part of the <glossary tag="Internet library">Internet library</glossary>. To ensure that the <glossary tag="command">command</glossary> works in a <glossary tag="standalone application">standalone application</glossary>, you must include this <glossary tag="LiveCode custom library">custom library</glossary> when you create your <glossary tag="standalone application">standalone</glossary>. In the Inclusions section of the <glossary tag="Standalone Application Settings">Standalone Application Settings</glossary> window, make sure "Internet Library" is selected in the list of script libraries.</p>
  </description>
</doc>