mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-10 15:32:05 -03:30
Revert changes to exception handling in RealmsAdminResource#importRealm
- ModelDuplicateException and ModelIllegalException were wrongfully handled as ModelException, returning wrong status code Signed-off-by: Stefan Guilhen <sguilhen@redhat.com> Closes #39753
This commit is contained in:
parent
43a7b27301
commit
75e6d7214a
@ -176,6 +176,12 @@ public class RealmsAdminResource {
|
||||
} catch (PasswordPolicyNotMetException e) {
|
||||
logger.error("Password policy not met for user " + e.getUsername(), e);
|
||||
throw ErrorResponse.error("Password policy not met. See logs for details", Response.Status.BAD_REQUEST);
|
||||
} catch (ModelIllegalStateException mise) {
|
||||
logger.error(mise.getMessage(), mise);
|
||||
throw ErrorResponse.error(mise.getMessage(), Response.Status.INTERNAL_SERVER_ERROR);
|
||||
} catch (ModelDuplicateException mde) {
|
||||
logger.error("Conflict detected", mde);
|
||||
throw ErrorResponse.exists(mde.getMessage());
|
||||
} catch (ModelException e) {
|
||||
throw ErrorResponse.error(e.getMessage(), Response.Status.BAD_REQUEST);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user