Moving method addUserAccount out of conditional block which checks for contraint violations

This commit is contained in:
Ravi Avhad 2021-07-24 14:25:40 +05:30
parent d63ff1db32
commit 6b3e8de50f
1 changed files with 1 additions and 2 deletions

View File

@ -31,11 +31,10 @@ public class UserAccountService {
sb.append(constraintViolation.getMessage());
}
dao.addUserAccount(useraccount);
throw new ConstraintViolationException("Error occurred: " + sb.toString(), violations);
}
dao.addUserAccount(useraccount);
return "Account for " + useraccount.getName() + " Added!";
}