log URL errors

This commit is contained in:
François Briatte 2017-01-01 19:05:09 +01:00
parent 3fef0b5ce4
commit 3f9c3556d0

View File

@ -36,7 +36,7 @@ cat(length(l), "unique\n")
for (i in l) { for (i in l) {
if (!which(l == i) %% 25) if (!which(l == i) %% 50)
cat(length(l) - which(l == i), "left\n") cat(length(l) - which(l == i), "left\n")
x <- try(GET(i) %>% x <- try(GET(i) %>%
@ -44,9 +44,15 @@ for (i in l) {
silent = TRUE) silent = TRUE)
if (!"try-error" %in% class(x) && x != 200) { if (!"try-error" %in% class(x) && x != 200) {
cat("x")
sink("check.log", append = TRUE)
cat("\nURL:", i, "\nStatus code:", x, "\n") cat("\nURL:", i, "\nStatus code:", x, "\n")
sink()
} else if("try-error" %in% class(x)) { } else if("try-error" %in% class(x)) {
cat("x")
sink("check.log", append = TRUE)
cat("\nURL:", i, "\nFailed to access\n.") cat("\nURL:", i, "\nFailed to access\n.")
sink()
} else { } else {
cat(".") cat(".")
} }