Moving method addUserAccount out of conditional block which checks for contraint violations
@@ -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!";
}
