# 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
"),
error = function(x) cat(class(x), "got it
"))
Run the code above in your browser using DataLab