public static void unfailable ( final @ Nonnull ThrowingRunnable runnable ) { try { runnable . run ( ) ; } catch ( final Exception exc ) { Optional . ofNullable ( Thread . currentThread ( ) . getUncaughtExceptionHandler ( ) ) . ifPresent ( ueh -> ueh . uncaughtException ( Thread . currentThread ( ) , exc ) ) ; } }
Runs the given ThrowingRunnable and catches all Exceptions reporting them to the uncaught exception handler .