diff --git a/src/main/java/core/basesyntax/UserService.java b/src/main/java/core/basesyntax/UserService.java index c7c274a5..e8349858 100644 --- a/src/main/java/core/basesyntax/UserService.java +++ b/src/main/java/core/basesyntax/UserService.java @@ -5,10 +5,10 @@ public void registerUser(User user) { PasswordValidator passwordValidator = new PasswordValidator(); try { passwordValidator.validate(user.getPassword(), user.getRepeatPassword()); + saveUser(user); } catch (Exception exception) { System.out.println("Your passwords are incorrect. Try again."); } - saveUser(user); } public void saveUser(User user) {