Search in sources :

Example 1 with SourceException

use of com.vaadin.data.Buffered.SourceException in project VaadinUtils by rlsutton1.

the class ViolationConstraintHandler method expandException.

/**
 * logs the initial error and calls the recusive version of it'self. always
 * throws a runtime exception
 *
 * @param e
 */
static void expandException(Throwable e) {
    if (e instanceof RuntimeException && e.getCause() instanceof Buffered.SourceException) {
        SourceException ex = (Buffered.SourceException) e.getCause();
        if (ex.getCause() instanceof PersistenceException) {
            handlePersistenceException(ex);
        }
    }
    logger.error(e, e);
    handleConstraintViolationException(e, 5);
    throw new RuntimeException(e);
}
Also used : PersistenceException(javax.persistence.PersistenceException) SourceException(com.vaadin.data.Buffered.SourceException) SourceException(com.vaadin.data.Buffered.SourceException) Buffered(com.vaadin.data.Buffered)

Aggregations

Buffered (com.vaadin.data.Buffered)1 SourceException (com.vaadin.data.Buffered.SourceException)1 PersistenceException (javax.persistence.PersistenceException)1