Error handling.

The doc <- is what you are trying to catch the error on, right? if so, do you want the h <- line outside of the tryCatch? Otherwise you risk running into an error with basicHeaderGatherer that would return "error ... with url: obs_url" but that is before you plug in the url, so it isn't caused by it. Probably best to just let any error on basicHead.. come right through. Could just most line 93 above the TC.