Function for gracefully failing internet resources
Source
Gracefully failing HTTP request code (slightly adapted by Pyry Kantanen) from RStudio community member kvasilopoulos. Many thanks!
Source of the original RStudio community discussion: https://community.rstudio.com/t/internet-resources-should-fail-gracefully/49199