Skip to content

Commit

Permalink
HADOOP-17837: Add unresolved endpoint value to UnknownHostException (#…
Browse files Browse the repository at this point in the history
…3272)

(cherry picked from commit 5e54d92)
  • Loading branch information
bbeaudreault authored and jojochuang committed Aug 6, 2021
1 parent e9ba4f4 commit 7659b62
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ public static void connect(Socket socket,
} catch (SocketTimeoutException ste) {
throw new ConnectTimeoutException(ste.getMessage());
} catch (UnresolvedAddressException uae) {
throw new UnknownHostException(uae.getMessage());
throw new UnknownHostException(endpoint.toString());
}

// There is a very rare case allowed by the TCP specification, such that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public void testInvalidAddress() throws Throwable {
fail("Should not have connected");
} catch (UnknownHostException uhe) {
LOG.info("Got exception: ", uhe);
assertEquals("invalid-test-host:0", uhe.getMessage());
}
}

Expand Down

0 comments on commit 7659b62

Please sign in to comment.