From ff89a31fa4ab98b143d546924de2962195c884f6 Mon Sep 17 00:00:00 2001 From: Udara Pathum Date: Mon, 22 Jan 2024 17:39:54 +0530 Subject: [PATCH] Use 404 response when invalid roleID id given --- .../carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java index 2d3a04aa2..fea1f231d 100644 --- a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java +++ b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java @@ -714,7 +714,7 @@ private void doUpdateRoleName(RoleV2 oldRole, RoleV2 newRole) } } - private String getCurrentRoleName(String roleId, String tenantDomain) throws CharonException, BadRequestException { + private String getCurrentRoleName(String roleId, String tenantDomain) throws CharonException, NotFoundException { String currentRoleName; try { @@ -724,7 +724,7 @@ private String getCurrentRoleName(String roleId, String tenantDomain) throws Cha } } catch (IdentityRoleManagementException e) { if ((ROLE_NOT_FOUND.getCode()).equals(e.getErrorCode())) { - throw new BadRequestException(e.getMessage()); + throw new NotFoundException(e.getMessage()); } throw new CharonException(String.format("Error occurred while getting the role name by " + "the role id: %s", roleId), e);