paascloud/paascloud-master · error · UacBizException

UAC10012001

UAC10012001

Error message

UAC10012001

What it means

Fires in UacActionServiceImpl.getCheckedActionList when roleId is null. It is a plain null-sentinel guard thrown before the mapper query executes, indicating the caller asked for the actions checked under a role without supplying which role; caller must provide a valid non-null roleId.

Solutions

  1. Always pass a valid roleId; require it at the controller layer
  2. On the client, disable the action-tree request until a role is selected
  3. Validate roleId != null before calling the service

Example fix

// before
List<Long> ids = uacActionService.getCheckedActionList(roleDto.getId());
// after
Preconditions.checkNotNull(roleDto.getId(), "roleId is required");
List<Long> ids = uacActionService.getCheckedActionList(roleDto.getId());
Defensive patterns

Strategy: validation

Validate before calling

if (roleId == null) { return Collections.emptyList(); }

Type guard

null

Try / catch

try { return service.getCheckedActionList(roleId); } catch (UacBizException e) { return Collections.emptyList(); }

Prevention

When it happens

Trigger: getCheckedActionList(null), typically when the role selection was not propagated from the UI or the LoginAuthDto/context lacked a role id.

Common situations: Role checkbox tree loaded before a role is selected; controller passes null path variable; frontend state not initialized.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of paascloud/paascloud-master@781281a950 (2026-09-10). Data as JSON: /api/errors/eb1c28e61459f4d9. Report an issue: GitHub.

Appendix: source

Thrown at paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacActionServiceImpl.java:122

			int result = uacActionMapper.updateByPrimaryKeySelective(action);
			if (result < 1) {
				throw new UacBizException(ErrorCodeEnum.UAC10014003);
			}
		}
	}

	@Override
	public int deleteByMenuId(Long id) {
		Preconditions.checkArgument(id != null, "菜单ID不能为空");

		return uacActionMapper.deleteByMenuId(id);
	}

	@Override
	@Transactional(readOnly = true, rollbackFor = Exception.class)
	public List<Long> getCheckedActionList(Long roleId) {
		if (roleId == null) {
			throw new UacBizException(ErrorCodeEnum.UAC10012001);
		}
		return uacActionMapper.getCheckedActionList(roleId);
	}

	@Override
	@Transactional(readOnly = true, rollbackFor = Exception.class)
	public List<MenuVo> getOwnAuthList(Long userId) {
		return uacActionMapper.getOwnAuthList(userId);
	}

	@Override
	@Transactional(readOnly = true, rollbackFor = Exception.class)
	public List<Long> getCheckedMenuList(Long roleId) {
		if (roleId == null) {
			throw new UacBizException(ErrorCodeEnum.UAC10012001);
		}
		return uacActionMapper.getCheckedMenuList(roleId);
	}

View on GitHub (pinned to 781281a950)