title: Global Exception Handling in an Eclipse RCP app
body: <p>I want to override the global Exception Handling in my <code>RCP</code> app. Whenever an uncaught Exception happens I want to log it (using <code>java</code> logging) and then exit the app. I have already overwritten the <code>eventLoopException(Throwable exception)</code> method in the <code>ApplicationWorkbenchAdvisor</code> class. But this catches only the event loop exceptions. As of now I have also overwritten the <code>postStartup()</code> method like this:</p>
  
  <pre><code>public void postStartup()
  {
      Policy.setStatusHandler(new StatusHandler()
      {
         @Override
            public void show(IStatus status, String title)
            {
              LOGGER.log(Level.SEVERE, "Uncaught Exception", status.getException());
              UnexpectedErrorDialog();
              PlatformUI.getWorkbench().close();
            }
      });
  }
  </code></pre>
  
  <p>It logs the exception in my log file and exits the app. But it's obviously not right and the exception is shown twice in the console, cause all I do is intercepting the showing of the exception in a <code>gui dialog</code> to the user. So how can I properly overwrite/change the global exception handling, so that my code (log) is used instead of the default one?</p>