I would like to use sys.sleep function when the request of an API I am using gives me an error back. Like this one:
Error in open.connection(con, "rb") : HTTP error 429.
Should I use trycatch?
data<- fromJSON("https://api.com")
Thanks !
I would like to use sys.sleep function when the request of an API I am using gives me an error back. Like this one:
Error in open.connection(con, "rb") : HTTP error 429.
Should I use trycatch?
data<- fromJSON("https://api.com")
Thanks !
You can use try catch
tryCatch(myfunc(), error=function(e) Sys.sleep(1))