Merge pull request #3775 from hmlnarik/KEYCLOAK-2847-Unexpected-error-when-trying-to-update-clientTemplate-to-already-existing-name

KEYCLOAK-2847 Fix exception convertor for Wildfly
This commit is contained in:
Stian Thorgersen 2017-01-23 13:00:58 +01:00 committed by GitHub
commit 99e1eac094

View file

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