TST: Implement external error raised helper function.
- [x] ref #30999
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Opened PR for what @gfyoung wrote [here](https://github.com/pandas-dev/pandas/issues/30999#issuecomment-575426086)
Restarting the tests, as it failed to fetch a URL. gentle ping @gfyoung  Sorry for the delay @MomIsBestFriend!  Thanks for the work! @gfyoung Thank you, you are the one who wrote it ;)