public void handleThrowable ( Throwable e , Object target ) { try { ExceptionCallback exceptionCallback = ( ExceptionCallback ) target ; if ( e instanceof Exception ) { exceptionCallback . exceptionThrown ( ( Exception ) e ) ; } else { exceptionCallback . exceptionThrown ( new RuntimeException ( e ) ) ; } } catch ( IllegalArgumentException | ClassCastException e1 ) { log . fatal ( "unable to provide callback for: " + target . toString ( ) , e ) ; } }
tries everything to log the exception