
Last chance! 50% off unlimited learning
Sale ends in
api_error_handler(.data, fun)
api
api_body
,
api_config
, api_query
,
api
, auth
## Not run:
# # Use functions from httr
# api('https://api.github.com/') %>%
# api_error_handler(stop_for_status)
#
# api('https://api.github.com/') %>%
# api_error_handler(warn_for_status)
#
# # Custom error handling functions
# my_stop <- function(x) {
# if (x$status > 200) {
# warning("nope, try again", call. = FALSE)
# }
# }
# api("http://httpbin.org/status/404") %>%
# api_error_handler(my_stop)
# ## End(Not run)
Run the code above in your browser using DataLab