R/utils.R

Defines functions err_print tryGet

tryGet = function(code) {
  tryCatch(code,
           error = function(c) {
             message(c)
             return("error")
           },
           warning = function(c) {
             message(c)
             return("warning")
           }
  )
}

err_print = function() {
  msg = paste0("\n", "Conection error.", "\n", "If the problem persists, ",
               "try a different download method from 'download.file()' ",
               "and/or increase timeout 'options(timeout = 600)'.")
  message(msg)
}

Try the rgugik package in your browser

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

rgugik documentation built on April 12, 2025, 1:53 a.m.