title: Which java.lang.Error descendant are safe to catch?
body: <p>Its absolutely clear for me, that usually a Java program should not catch <code>Throwable</code>, since it is catching <code>Error</code>-s like <code>OutOfMemoryError</code>. 100% clear.</p>
  
  <p>But.</p>
  
  <p>If I have a multi-threaded application, it is usually a best practice, that I should have an <code>UncaughtExceptionHandler</code>, which does something if <code>RuntimeException</code> or <code>Error</code> happens. What I usually want to do, is simply logging. Logging <code>RuntimeExceptions</code> cannot really hurt, thats clear. But the question arises in me: </p>
  
  <p><strong>Which errors can I catch and log safely in an UncaughtExceptionHandler, which will not treat my whole application if I log it? Which errors are there, which does not mean, that the application must stop immediately?</strong> </p>
  
  <p>For example if I get an <code>OutOfMemoryError</code>, I would just ask for a <code>printStackTrace</code> to standard out, since the memory need of logging it can kill other threads. But a <strong><code>StackOverflowError</code> seems to me totally safe to be logged</strong>, since it means simply, that the stack area of the current thread became full. It is safe to log it. <strong>Which other <code>Error</code> descendants would you log?</strong></p>