paascloud/paascloud-master · error · UacBizException
UAC10015002
UAC10015002
Error message
UAC10015002
What it means
UAC10015002 is thrown by updateUacGroupStatusById when the supplied status value is not one recognized by UacGroupStatusEnum.contains(status). It guards against writing an invalid lifecycle status to the group record.
Solutions
- Log the received status and compare it with UacGroupStatusEnum values; use only the defined constants (e.g. UacGroupStatusEnum.ENABLE.getStatus())
- Fix the client/request mapping so status is serialized as the enum's integer code
- Add request validation (a @Range or custom validator) on the status parameter before reaching the service
Example fix
// before
int status = Integer.parseInt(request.getParameter("status")); // "enabled" -> NumberFormatException or wrong code
uacGroupService.updateUacGroupStatusById(groupId, status);
// after
UacGroupStatusEnum statusEnum = UacGroupStatusEnum.getByStatus(status);
if (statusEnum == null || !UacGroupStatusEnum.contains(status)) {
throw new UacBizException(ErrorCodeEnum.UAC10015002);
}
uacGroupService.updateUacGroupStatusById(groupId, status); Defensive patterns
Strategy: validation
Validate before calling
if (!UacGroupStatusEnum.contains(status)) {
throw new UacBizException(ErrorCodeEnum.UAC10015002);
}
uacGroupService.updateUacGroupStatusById(groupId, status); Type guard
UacGroupStatusEnum e = UacGroupStatusEnum.getByStatus(status);
if (e == null) { throw new IllegalArgumentException("Unsupported status: " + status); } Try / catch
try {
uacGroupService.updateUacGroupStatusById(groupId, status);
} catch (UacBizException e) {
if (ErrorCodeEnum.UAC10015002.getCode().equals(e.getCode())) { /* reject invalid status in request layer */ }
else throw e;
} Prevention
- Use UacGroupStatusEnum constants instead of raw ints
- Validate status at the controller/DTO layer with a validator
- Document allowed status codes in the API contract
When it happens
Trigger: Calling updateUacGroupStatusById(groupId, status) with a status integer outside the UacGroupStatusEnum set (e.g. 2, -1, or a raw string-converted number instead of the defined ENABLE/DISABLE codes).
Common situations: Client sends status as a string like "enabled" and it is parsed incorrectly; enum values changed in a newer version while an old client still sends legacy codes; a REST caller guesses status codes instead of using the documented constants.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
AI-assisted analysis of paascloud/paascloud-master@781281a950 (2026-09-10).
Data as JSON: /api/errors/deff14aa189afc8b.
Report an issue: GitHub.
Appendix: source
Thrown at paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacGroupServiceImpl.java:86
return uacGroupMapper.updateByPrimaryKeySelective(group);
}
@Override
public int updateUacGroupStatusById(IdStatusDto idStatusDto, LoginAuthDto loginAuthDto) {
Long groupId = idStatusDto.getId();
Integer status = idStatusDto.getStatus();
UacGroup uacGroup = new UacGroup();
uacGroup.setId(groupId);
uacGroup.setStatus(status);
UacGroup group = uacGroupMapper.selectByPrimaryKey(groupId);
if (PublicUtil.isEmpty(group)) {
throw new UacBizException(ErrorCodeEnum.UAC10015001, groupId);
}
if (!UacGroupStatusEnum.contains(status)) {
throw new UacBizException(ErrorCodeEnum.UAC10015002);
}
//查询所有的组织
List<UacGroup> totalGroupList = uacGroupMapper.selectAll();
List<GroupZtreeVo> totalList = Lists.newArrayList();
GroupZtreeVo zTreeVo;
for (UacGroup vo : totalGroupList) {
zTreeVo = new GroupZtreeVo();
zTreeVo.setId(vo.getId());
totalList.add(zTreeVo);
}
UacGroupUser uacGroupUser = new UacGroupUser();
uacGroupUser.setUserId(loginAuthDto.getUserId());
UacGroupUser groupUser = uacGroupUserMapper.selectOne(uacGroupUser);
// 查询当前登陆人所在的组织信息
UacGroup currentUserUacGroup = uacGroupMapper.selectByPrimaryKey(groupUser.getGroupId());
// 查询当前登陆人能禁用的所有子节点View on GitHub (pinned to 781281a950)