-
Notifications
You must be signed in to change notification settings - Fork 3
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
URLConnection throws incorrect exception if address cannot be resolved #30
Comments
Comment author: @guillerodriguez According to the API specification, the URLConnection.connect() method should throw an IOException if an error occurs. However in GNU Classpath if the address can be resolved, an java.nio.channels.UnresolvedAddressException is thrown instead. UnresolvedAddressException is a subclass of IllegalArgumentException, not IOException, so this breaks the API contract. Here is a sample test case:
This results in the following:
Note that the JDK does the right thing here:
|
Comment author: @guillerodriguez "if the address can be resolved.." should have been "if the address can't be resolved". |
Note: this issue was migrated automatically using bugzilla2github
Original bug ID: BZ#70661
From: @guillerodriguez
Reported version: 0.99
The text was updated successfully, but these errors were encountered: