Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid warning if good symbol follows failed symbol
The first attempt to download a valid symbol will unexpectedly fail after an invalid symbol fails as expected. I ran the code below after setting 'silent = FALSE' in the try() calls, so I could see the error. getSymbols("IBM;dummy1;GE", env = (e <- new.env()), verbose = TRUE) ## downloading IBM ..... ## done. ## downloading dummy1 ..... ## Warning: dummy1 download failed; trying again. ## Warning: Unable to import “dummy1”. ## dummy1 download failed after two attempts. Error message: ## HTTP error 404. ## downloading GE ..... ## Error in open.connection(file, "rt") : ## Handle is already in use elsewhere. ## Warning: GE download failed; trying again. The error suggests we need to close the connection after a failed download in order to release the handle. Then re-create the connection for any further download attempts. Thanks to @helgasoft for the report and patch. Fixes #307.
- Loading branch information