-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
raise HTTP::Request::InvalidURIError for wrong url's #723
base: main
Are you sure you want to change the base?
Conversation
rescue Addressable::URI::InvalidURIError => e | ||
raise HTTP::Request::InvalidURIError, e.message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should move this to HTTP::URI.parse
instead? And probably call it HTTP::URI::InvalidError
raise(InvalidURIError, "empty uri provided") if @uri.host.nil? | ||
raise(UnsupportedMethodError, "unknown method: #{verb}") unless METHODS.include?(@verb) | ||
raise(UnsupportedSchemeError, "unknown scheme: #{scheme}") unless SCHEMES.include?(@scheme) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, all of the above should raise ArgumentError
. Please make this method private. Furthermore, what are your thoughts on renaming it to validate!
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a
Really enjoy using your gem, so decided to study internal of it better.
is there any better way to understand internals, when contributing to gem directly? I guess, not.
This PR addressed an issue that is assigned for 5.0 milestone
closes #565