Skip to content

Commit

Permalink
remade the error throwing for already existing user
Browse files Browse the repository at this point in the history
  • Loading branch information
kiloutyg committed Feb 2, 2024
1 parent 144a86d commit 4592bd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Service/AccountService.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function createAccount(Request $request)
// check if the username is already in use
$user = $this->userRepository->findOneBy(['username' => $name]);
if ($user) {
$error = 'Ce nom d\'utilisateur est déja utilisé.';
throw new \Exception('Ce nom d\'utilisateur est déja utilisé.');
} else {
// create the user
$user = new User();
Expand Down

0 comments on commit 4592bd3

Please sign in to comment.