tools/make-errorcodes.R
raw| 1 | lines <- readLines('tools/errorcodes.txt') |
| 2 | errors <- grep('^CURLE', lines, value = TRUE)[-1] |
| 3 | error_codes <- sub(",.*", "", errors) |
| 4 | stopifnot(error_codes[100] == "CURLE_TOO_LARGE") |
| 5 | error_codes <- sub("^curle_", "curl_error_", tolower(error_codes)) |
| 6 | out <- file('R/errcodes.R', 'w') |
| 7 | writeLines("# This file is autogenerated using make-errorcodes.R", out) |
| 8 | writeLines("libcurl_error_codes <- ", out) |
| 9 | dput(error_codes, out) |
| 10 | close(out) |
| 11 |