if (FALSE) {
x <- GET("http://httpbin.org/status/200")
stop_for_status(x) # nothing happens
warn_for_status(x)
message_for_status(x)
x <- GET("http://httpbin.org/status/300")
stop_for_status(x)
warn_for_status(x)
message_for_status(x)
x <- GET("http://httpbin.org/status/404")
stop_for_status(x)
warn_for_status(x)
message_for_status(x)
# You can provide more information with the task argument
warn_for_status(x, "download spreadsheet")
message_for_status(x, "download spreadsheet")
}
Run the code above in your browser using DataLab