Skip to content
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

io.netty.channel.unix.Errors should rethrow EHOSTUNREACH as NoRouteToHostException instead of generic ConnectException #13317

Closed
tristantarrant opened this issue Apr 2, 2023 · 0 comments · Fixed by #13318

Comments

@tristantarrant
Copy link
Contributor

Expected behavior

Connecting to an unreachable host should throw a NoRouteToHostException

Actual behavior

Netty throws java.net.ConnectException: finishConnect(..) failed: No route to host

Steps to reproduce

Attempt to connec to an unreachable host

Minimal yet complete reproducer code (or URL to code)

Netty version

4.1.90.Final

JVM version (e.g. java -version)

11

OS version (e.g. uname -a)

Linux

The code in io.netty.channel.unix.Errors.newConnectException0() should handle EHOSTUNREACH as it already handles ENETUNREACH

normanmaurer pushed a commit that referenced this issue Apr 3, 2023
…13318)

Motivation:

    We should throw a NoRouteToHostException when a socket connection fails with EHOSTUNREACH in the same way as
    ENETUNREACH.

    Modifications:

    Add handling for EHOSTUNREACH

    Result:

    Correct exception is thrown.
normanmaurer pushed a commit that referenced this issue Apr 3, 2023
…13318)

Motivation:

    We should throw a NoRouteToHostException when a socket connection fails with EHOSTUNREACH in the same way as
    ENETUNREACH.

    Modifications:

    Add handling for EHOSTUNREACH

    Result:

    Correct exception is thrown.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant