http
http copied to clipboard
Better error messages for invalid URLs
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
Totally agree!