-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Improved error messages if an invalid URL was passed #1442
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
Conversation
Hi @bahrmichael Thanks, but I think the current checks are perfectly valid as they currently are and the ones you would like should actually be in the Could you please update your PR? Thanks! those new/different messages are not in the right place. |
I will. |
Thanks! |
Thanks for reacting so fast! First open source PR merged 🎉 |
Motivation: Following #1442, we shouldn't accept Uri with empty scheme or empty host, such as "http://". Modifications: * Introduce MiscUtils#isEmpty(String) * Throw IllegalArgumentException on empty scheme or host, with message mentioning missing field and original url Result: Better control on Uri that could cause AHC to choke
Congrats! Hopefully more will follow and you'll get used to it ;-) Please note the follow up in #1445 |
Motivation: Following #1442, we shouldn't accept Uri with empty scheme or empty host, such as "http://". Modifications: * Introduce MiscUtils#isEmpty(String) * Throw IllegalArgumentException on empty scheme or host, with message mentioning missing field and original url Result: Better control on Uri that could cause AHC to choke
currently leads to
This may be confusing at first, so I changed the value passed from the Uri constructor to assertNotNull to be more descriptive.