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:
commit
19b82f00d4
2 changed files with 2 additions and 2 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue