KEYCLOAK-2847 Fix exception convertor for Wildfly

This commit is contained in:
Hynek Mlnarik 2017-01-19 18:11:51 +01:00
parent 536b88790e
commit 13e4f607ad

View file

@ -55,7 +55,7 @@ public class PersistenceExceptionConverter implements InvocationHandler {
public static ModelException convert(Throwable t) { public static ModelException convert(Throwable t) {
if (t.getCause() != null && t.getCause() instanceof ConstraintViolationException) { if (t.getCause() != null && t.getCause() instanceof ConstraintViolationException) {
throw new ModelDuplicateException(t); throw new ModelDuplicateException(t);
} if (t instanceof EntityExistsException) { } if (t instanceof EntityExistsException || t instanceof ConstraintViolationException) {
throw new ModelDuplicateException(t); throw new ModelDuplicateException(t);
} else { } else {
throw new ModelException(t); throw new ModelException(t);