steveloughran commented on a change in pull request #3272:
URL: https://github.com/apache/hadoop/pull/3272#discussion_r684137107



##########
File path: 
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestNetUtils.java
##########
@@ -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());

Review comment:
       Use `GenericTestUtils.assertExceptionContains()`; this rethrows the 
exception if there's no match, and allows for extra text in the messge

##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetUtils.java
##########
@@ -589,7 +589,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());

Review comment:
       we still need that message from the original string so build it from 
`uhe.getMessage() + " " + endpoint`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to