@SuppressWarnings("PMD.AvoidCatchingThrowable") public void handleSafely(UnexpectedThrowableEventHandler handler){
  checkNotNull(handler,"Handler cannot be null");
  try {
    if (!(throwable instanceof InterruptedException)) {
      handler.handle(throwable,message,fatal);
    }
  }
 catch (  Throwable throwable) {
    try {
      logger.log(Level.SEVERE,"Failed to handle safely",throwable);
    }
  finally {
      SafeShutdown.exit(1);
    }
  }
 finally {
    shutdownIfFatal();
  }
}

@ SuppressWarnings ( "PMD.AvoidCatchingThrowable" ) public void handleSafely ( UnexpectedThrowableEventHandler handler ) { checkNotNull ( handler , "Handler cannot be null" ) ; try { if ( ! ( throwable instanceof InterruptedException ) ) { handler . handle ( throwable , message , fatal ) ; } } catch ( Throwable throwable ) { try { logger . log ( Level . SEVERE , "Failed to handle safely" , throwable ) ; } finally { SafeShutdown . exit ( 1 ) ; } } finally { shutdownIfFatal ( ) ; } }
handles the exception , this method can only be called once if the event is fatal . if the event is fatal then this method will never return .
