Description
In a recent change (d884d1a) to fix #50868, there are calls to _InternetAddress.fromString()
that will throw (and then catch) ArgumentError
whenever the URI contains a hostname and not an IP address.
This is not itself a bug/problem and everything works as expected. However, a lot of users are running with "break on all exceptions" ticked in VS Code and breaking here is causing some confusion. I've explained the issue here although that's not very visible unless you read the entire thread.
I think that issue should probably be closed (because as far as I can tell everything is working as expected), but since fetching URLs using hostnames is very common I thought it was worth seeing if that code could be altered to not rely on throwing/catching for this flow. While I think users shouldn't generally run with "Break on all exceptions" enabled (the default is "Break on uncaught exceptions"), the less "noise" there is when running in that mode, the easier it'll be to track down actual issues caused by unexpected exceptions being thrown and caught.