My R code is as follows
errors = 0
for(i in c(1:100)){
tryCatch(expr = {
API Call
}, error = {errors=errors+1}, finally = {})
further code
}
The code is meant to continue execution even if the API call fails and count the number of times error occurred. But I see that if for an iteration there is an error in API call, the code is not executed for further iterations. If I use try(), then I wont be able to count the number of errors.