catch invalid uri

if URI.parse does not result in a host we don't continue and raise
an error
Merge pull request #3119 from teaforthecat/catch-invalid-endpoint

[aws] catch invalid uri