title: UnknownHostException is not recognized in catch block
body: <p>One of the method in my code throws <code>UnknownHostException</code> exception</p>
  
  <p>I first had a <code>catch</code> block like this:</p>
  
  <pre><code>catch (Exception e) {
    // TODO Auto-generated catch block
    System.out.println("Custom Message "+e.getMessage());
    if(e instanceof java.net.UnknownHostException){
        System.out.println("Unknown Host Ex");
    }else{
        System.out.println("OTHER ERROR");
    }
  }
  </code></pre>
  
  <p>I am facing a problem where that <code>if</code> condition never evaluates to true and hence I am not able to output that there is some host error.</p>
  
  <p>You can see I have a <code>sysout</code> just before that which prints this :</p>
  
  <pre><code>Custom Message ; nested exception is: 
      java.net.UnknownHostException: abc.xyz
  </code></pre>
  
  <p>After that I wrote a seperate catch block to handle <code>UnknownHostException</code> but still is it not getting catched.</p>