title: Can't catch the exception - Java with HtmlUnit?
body: <p>I don't understand what's going on ???</p>
  
  <p>I have the following code :</p>
  
  <pre><code>public static void main(String[] args){ 
  
      WebClient wc = null;
      HtmlPage hp = null;
      ArrayList&lt;Product&gt; allProducts;
      try{
          wc = new WebClient(BrowserVersion.FIREFOX_3_6);
          hp = wc.getPage("http://www.mega.co.il/");
      }catch (Exception e) {
  
      }
      finally{
          allProducts = getProducts(wc, hp);
          for (Product product : allProducts) {
              System.out.println(product);
          }
      }
  }
  </code></pre>
  
  <p>and still the console shows an javax.net.ssl.SSLPeerUnverifiedException being thrown in the 
  hp = wc.getPage("http://www.mega.co.il/"); line :</p>
  
  <pre><code>    Aug 3, 2011 10:45:19 PM com.gargoylesoftware.htmlunit.html.BaseFrame loadInnerPageIfPossible
  SEVERE: IOException when getting content for iframe: url=[http://www.mega.co.il/jsfweb/logins/rightLoginHPIframe.jsf]
  javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
      at com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPeerCertificates(Unknown Source)
      at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)
      at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:339)
      at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:123)
      at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:147)
      at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:108)
      at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415)
      at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641)
      at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:597)
      at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:133)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1405)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1459)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1324)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:303)
      at com.gargoylesoftware.htmlunit.html.BaseFrame.loadInnerPageIfPossible(BaseFrame.java:141)
      at com.gargoylesoftware.htmlunit.html.BaseFrame.loadInnerPage(BaseFrame.java:100)
      at com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames(HtmlPage.java:1763)
      at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:204)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:436)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:307)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:369)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:354)
      at DBSniffer.main(DBSniffer.java:107)
  </code></pre>
  
  <p>can someone explain me what's going on?</p>
  
  <p>P.S<br/>
  Somehow the application proceed to run !?</p>
  
  <p>Thanks in advance,
  Dan</p>