Error Handling Table of Contents Retry a statement on error Retry a statement on error howto ret = NULL attempt = 0 MAX_ATTEMPT = 100 while (is.null(ret) & attempt < MAX_ATTEMPT) { attempt = attempt + 1 try({ ret = functionMayFail() }, silent = TRUE) } stopifnot(!is.null(ret)) https://stackoverflow.com/questions/20770497/how-to-retry-a-statement-on-error