http icon indicating copy to clipboard operation
http copied to clipboard

Better error messages for invalid URLs

Open shaicoleman opened this issue 6 years ago • 1 comments

HTTP.get(nil)
HTTP::Request::UnsupportedSchemeError (unknown scheme: )

HTTP.get('')
HTTP::Request::UnsupportedSchemeError (unknown scheme: )

HTTP.get('/')
HTTP::Request::UnsupportedSchemeError (unknown scheme: )

HTTP.get(':')
Addressable::URI::InvalidURIError (Cannot assemble URI string with ambiguous path: ':')

Ideally it should return InvalidURI exceptions if the URL is invalid instead of UnsupportedSchemeError, as it is less confusing. Ideally also, it should return the same exception for all these cases

shaicoleman avatar Sep 10 '19 11:09 shaicoleman

Totally agree!

ixti avatar Sep 10 '19 12:09 ixti