Skip to content

Conversation

@skatkov
Copy link

@skatkov skatkov commented Aug 13, 2022

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

Comment on lines +157 to +158
rescue Addressable::URI::InvalidURIError => e
raise HTTP::Request::InvalidURIError, e.message
Copy link
Member

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

Comment on lines +228 to +230
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)
Copy link
Member

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!?

@ixti ixti self-requested a review August 14, 2022 23:25
Copy link

@sakshirana1309 sakshirana1309 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a

@ixti ixti self-assigned this Apr 27, 2023
@ixti ixti added this to the v6.0.0 milestone Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better error messages for invalid URLs

3 participants