private static Optional < Exception > tryExecute ( final Runnable runnable , final SagaModule module ) { Exception executionException ; try { runnable . run ( ) ; executionException = null ; } catch ( Exception ex ) { executionException = ex ; LOG . error ( "Error executing function on module {}" , module , ex ) ; } return Optional . ofNullable ( executionException ) ; }
Executes the provided runnable without throwing possible exceptions .