Merge pull request #2527 from stianst/KEYCLOAK-2759

KEYCLOAK-2759 Fix error message when renaming realm to name that exists
This commit is contained in:
Stian Thorgersen 2016-04-07 06:50:55 +02:00
commit 19b82f00d4
2 changed files with 2 additions and 2 deletions

View file

@ -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);

View file

@ -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");
}
}