R/curlError.R

Defines functions getCurlErrorClassNames curlError

Documented in curlError getCurlErrorClassNames

curlError =
function(type, msg, asError = TRUE)
{
   if(!is.character(type)) {
     i = match(type, CURLcodeValues)
     typeName = if(is.na(i))
                   character()
                else
                   names(CURLcodeValues)[i]
   } 

   typeName = gsub("^CURLE_", "", typeName)

   fun = (if(asError) stop else warning)

   fun( structure(list(message = msg, call = sys.call()), class = c(typeName, "GenericCurlError", "error", "condition")) )
}


getCurlErrorClassNames =
function()
{
  gsub("^CURLE_", "", names(CURLcodeValues))
}

Try the RCurl package in your browser

Any scripts or data that you put into this service are public.

RCurl documentation built on Nov. 3, 2023, 1:09 a.m.