EVOLUTION-MANAGER
Edit File: curlError.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Raise a warning or error about a CURL problem</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for curlError {RCurl}"><tr><td>curlError {RCurl}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Raise a warning or error about a CURL problem</h2> <h3>Description</h3> <p>This function is called to raise an error or warning that arises from a curl operation when making a request. This is called from C code that encounters the error and this function is responsible for generating the error. </p> <h3>Usage</h3> <pre> curlError(type, msg, asError = TRUE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>type</code></td> <td> <p>the type of the error or a status code identifying the type of the error. Typically this is an integer value that identifies the type of the Curl error. The value corresponds to one of the enumerated value of type <code>CURLcode</code>.</p> </td></tr> <tr valign="top"><td><code>msg</code></td> <td> <p>the error message, as a character vector of length 1</p> </td></tr> <tr valign="top"><td><code>asError</code></td> <td> <p>a logical value that indicates whether to raise an error or a warning</p> </td></tr> </table> <h3>Value</h3> <p>This calls <code>warning</code> or <code>stop</code> with the relevant condition object. The object is always of basic (S3) class <code>GenericCurlError, error, condition</code> or <code>GenericCurlError, warning, condition</code>. When the <code>type</code> value corresponds to a <code>CURLCode</code> value, the condition has the primary class given by that <code>CURLCode</code>'s name, e.g. <code>COULDNT_RESOLVE_HOST</code>, <code>TOO_MANY_REDIRECTS</code> (with the CURLE prefix removed). </p> <h3>Author(s)</h3> <p>Duncan Temple Lang </p> <h3>References</h3> <p>libcurl documentation. </p> <h3>See Also</h3> <p><code><a href="curlPerform.html">curlPerform</a></code> </p> <h3>Examples</h3> <pre> # This illustrates generating and catching an error. # We intentionally give a mis-spelled URL. tryCatch(curlPerform(url = "ftp.wcc.nrcs.usda.govx"), COULDNT_RESOLVE_HOST = function(x) cat("resolve problem\n"), error = function(x) cat(class(x), "got it\n")) </pre> <hr /><div style="text-align: center;">[Package <em>RCurl</em> version 1.98-1.2 <a href="00Index.html">Index</a>]</div> </body></html>