According to the API specification, the URLConnection.connect() method should throw an IOException if an error occurs. However in GNU Classpath if the address cannot be resolved, a java.nio.channels.UnresolvedAddressException is thrown instead. UnresolvedAddressException is a subclass of IllegalArgumentException, not IOException, so this breaks the API contract.
I have added a bug in the bugtracker for this including sample code.