title: What is the proper way to handle exception inside callback?
body: <p>I've got a callback with exception instance. Currently i handle it this way, but i think that there is a better way. Would like to hear some comment from Java expert. =)</p>
  
  <pre><code>...
  onError(Exception e) {
     if (e instanceof IOException) {
        ioe = (IOException)e;
        // do smth with ioe
     } else if (e instanceof MyException) {
        mye = (MyException)e;
        // do smth with mye
     }
  }
  ...
  </code></pre>