@Override public boolean apply(Throwable input) { final List<Throwable> causalChain = Throwables.getCausalChain(input); for (String message : messages) { for (Throwable throwable : causalChain) { final String throwableMessage = throwable.getMessage(); if(throwableMessage != null && throwableMessage.contains(message)) { return false; } if(throwable instanceof JDODataStoreException) { final JDODataStoreException jdoDataStoreException = (JDODataStoreException) throwable; final Throwable[] nestedExceptions = jdoDataStoreException.getNestedExceptions(); for (Throwable nestedException : nestedExceptions) { final String nestedThrowableMessage = nestedException.getMessage(); if(nestedThrowableMessage != null && nestedThrowableMessage.contains(message)) { return false; } } } } } return true; } };