paascloud/paascloud-master · warning · UacBizException
UAC10011019
UAC10011019
Error message
邮箱已存在
What it means
UAC10011019 is thrown during registration when a UacUser template with the requested email yields selectCount > 0, meaning an account with that email already exists. Registration is rejected with '邮箱已存在' to keep emails unique (the email is also the activation/reset identity, see UAC10011004).
Solutions
- If the account exists, use login or 'forgot password' instead of registering again.
- Check email availability before submitting (validation endpoint or SELECT COUNT(*) FROM uac_user WHERE email = ?).
- Normalize/trim/lowercase the email on both insert and lookup to avoid case-variant duplicates.
- Debounce/disable the submit button server-side (idempotency key) to prevent double-registration races, and add a UNIQUE index on email.
Example fix
// before
UacUser q = new UacUser(); q.setEmail(registerDto.getEmail());
if (uacUserMapper.selectCount(q) > 0) { throw new UacBizException(ErrorCodeEnum.UAC10011019); }
// after
String email = registerDto.getEmail().trim().toLowerCase();
UacUser q = new UacUser(); q.setEmail(email);
if (uacUserMapper.selectCount(q) > 0) { throw new UacBizException(ErrorCodeEnum.UAC10011019); }
registerDto.setEmail(email); Defensive patterns
Strategy: validation
Validate before calling
UacUser q = new UacUser();
q.setEmail(requestedEmail.trim().toLowerCase());
if (uacUserMapper.selectCount(q) > 0) {
return Result.fail("email already registered; please log in or reset password");
} Try / catch
try {
uacUserService.register(registerDto);
} catch (UacBizException e) {
if ("UAC10011019".equals(e.getCode())) { return Result.fail(409, "email already exists"); }
throw e;
} Prevention
- Normalize email case/trim on insert and lookup.
- Debounce the register button / use idempotency keys to stop double submissions.
- Offer a clear 'already have an account? log in' path on the register screen.
- Add a UNIQUE index on email in the database.
When it happens
Trigger: Registering with an email already used by another account; retrying after a previous registration already created the row; email case differences (Foo@x.com vs foo@x.com) counting as the same user on case-insensitive collations; concurrent duplicate submissions (double-click on Register).
Common situations: Users forgetting they registered and hitting 'sign up' again; double-submit from an unthrottled form button; corporate shared mailboxes; migration leaving both legacy and new rows with the same email.
Related errors
AI-assisted analysis of paascloud/paascloud-master@781281a950 (2026-09-10).
Data as JSON: /api/errors/d9d9b7201f1c09f1.
Report an issue: GitHub.
Appendix: source
Thrown at paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacUserServiceImpl.java:974
UacUser uacUser = new UacUser();
uacUser.setLoginName(registerDto.getLoginName());
int count = uacUserMapper.selectCount(uacUser);
if (count > 0) {
throw new UacBizException(ErrorCodeEnum.UAC10011012);
}
uacUser = new UacUser();
uacUser.setMobileNo(registerDto.getMobileNo());
count = uacUserMapper.selectCount(uacUser);
if (count > 0) {
throw new UacBizException(ErrorCodeEnum.UAC10011013);
}
uacUser = new UacUser();
uacUser.setEmail(registerDto.getEmail());
count = uacUserMapper.selectCount(uacUser);
if (count > 0) {
throw new UacBizException(ErrorCodeEnum.UAC10011019);
}
}
}
View on GitHub (pinned to 781281a950)