Skip to content

Commit

Permalink
Fix invalid permission error handling issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanikaRuchini committed Nov 2, 2023
1 parent 6ff880e commit f11949a
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -942,9 +942,8 @@ private void doUpdatePermissions(String roleId, Set<String> addedPermissions, Se
} catch (IdentityRoleManagementException e) {
if (RoleConstants.Error.INVALID_REQUEST.getCode().equals(e.getErrorCode())) {
throw new BadRequestException(e.getMessage());
} else if (RoleConstants.Error.INVALID_PERMISSION.getCode()
.equals(ROLE_MANAGEMENT_ERROR_CODE_PREFIX + e.getErrorCode())) {
throw new BadRequestException(e.getMessage());
} else if (RoleConstants.Error.INVALID_PERMISSION.getCode().equals(e.getErrorCode())) {
throw new BadRequestException(e.getMessage(), ResponseCodeConstants.INVALID_VALUE);
}
throw new CharonException(
String.format("Error occurred while updating permissions of the role with ID: %s", roleId), e);
Expand Down

0 comments on commit f11949a

Please sign in to comment.