HADOOP-17837: Add unresolved endpoint value to UnknownHostException (#3272)
(cherry picked from commit 5e54d92e6e
)
This commit is contained in:
parent
e9ba4f4591
commit
7659b62682
@ -588,7 +588,7 @@ public static void connect(Socket socket,
|
|||||||
} catch (SocketTimeoutException ste) {
|
} catch (SocketTimeoutException ste) {
|
||||||
throw new ConnectTimeoutException(ste.getMessage());
|
throw new ConnectTimeoutException(ste.getMessage());
|
||||||
} catch (UnresolvedAddressException uae) {
|
} 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
|
// There is a very rare case allowed by the TCP specification, such that
|
||||||
|
@ -111,6 +111,7 @@ public void testInvalidAddress() throws Throwable {
|
|||||||
fail("Should not have connected");
|
fail("Should not have connected");
|
||||||
} catch (UnknownHostException uhe) {
|
} catch (UnknownHostException uhe) {
|
||||||
LOG.info("Got exception: ", uhe);
|
LOG.info("Got exception: ", uhe);
|
||||||
|
assertEquals("invalid-test-host:0", uhe.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user