Closed dhasenan closed 8 years ago
Oh, I see there's a convenience method that omits the validation flag. Except it just asserts that the URL wasn't malformed.
URL parsing falls under the category of input validation, and that means it's got to throw an Exception, not an Error. Even if an error were appropriate, it's not appropriate for it to be an AssertError with no message.
The method in uri to get a URL's scheme takes an out parameter that is set if the input is a malformed URL. Consistency is key. That pattern should either be replicated on all parsing methods or absent from all of them.