Moving method addUserAccount out of conditional block which checks for contraint violations
This commit is contained in:
parent
d63ff1db32
commit
6b3e8de50f
|
@ -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!";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue