title: Catching some exceptions but ignoring others - why doesn't this work?
body: <p>I have something similar to this.</p>
  
  <pre><code>void func() {
    try {
      //socket disconnects in middle of ..parsing packet..
    } catch(Exception ex) {
     if(!ex.getMessage().toString().equals("timeout") || !ex.getMessage().toString().equals("Connection reset")) {
       debug("Exception (run): " + ex.getMessage());
       ex.printStackTrace();
    }
  }
  </code></pre>
  
  <p>Why is it that when I get a connection reset exception or a timeout exception, it still goes inside the condition. I tried without toString and with no luck.</p>