KEYCLOAK-2759 Fix error message when renaming realm to name that exists

This commit is contained in:
Stian Thorgersen committed 2016-04-07 06:00:31 +02:00
1 parent 8de8446cb5
commit 2694e003c4
2 files changed
+2 -2

No files matched your search

@@ -266,7 +266,7 @@ public class RealmAdminResource {
} catch (PatternSyntaxException e) {
return ErrorResponse.error("Specified regex pattern(s) is invalid.", Response.Status.BAD_REQUEST);
} catch (ModelDuplicateException e) {
throw e;
return ErrorResponse.exists("Realm with same name exists");
} catch (Exception e) {
logger.error(e.getMessage(), e);
return ErrorResponse.error("Failed to update realm", Response.Status.INTERNAL_SERVER_ERROR);
@@ -151,7 +151,7 @@ public class RealmsAdminResource {
return Response.created(location).build();
} catch (ModelDuplicateException e) {
return ErrorResponse.exists("Realm " + rep.getRealm() + " already exists");
return ErrorResponse.exists("Realm with same name exists");
}
}