diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 7742416..63577d8 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -3,10 +3,6 @@ name: CI on: pull_request: -concurrency: - group: ci-${{ github.ref }} - cancel-in-progress: true - jobs: changed_files: name: Get Changed Files diff --git a/backend/src/main/java/de/szut/casino/exceptionHandling/GlobalExceptionHandler.java b/backend/src/main/java/de/szut/casino/exceptionHandling/GlobalExceptionHandler.java index 573abb8..df20fe0 100644 --- a/backend/src/main/java/de/szut/casino/exceptionHandling/GlobalExceptionHandler.java +++ b/backend/src/main/java/de/szut/casino/exceptionHandling/GlobalExceptionHandler.java @@ -2,7 +2,6 @@ package de.szut.casino.exceptionHandling; import de.szut.casino.exceptionHandling.exceptions.InsufficientFundsException; import de.szut.casino.exceptionHandling.exceptions.UserNotFoundException; -import jakarta.persistence.EntityExistsException; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; @@ -25,10 +24,4 @@ public class GlobalExceptionHandler { ErrorDetails errorDetails = new ErrorDetails(new Date(), ex.getMessage(), request.getDescription(false)); return new ResponseEntity<>(errorDetails, HttpStatus.BAD_REQUEST); } - - @ExceptionHandler(EntityExistsException.class) - public ResponseEntity> handleEntityExistsException(EntityExistsException ex, WebRequest request) { - ErrorDetails errorDetails = new ErrorDetails(new Date(), ex.getMessage(), request.getDescription(false)); - return new ResponseEntity<>(errorDetails, HttpStatus.CONFLICT); - } } diff --git a/backend/src/main/java/de/szut/casino/user/UserService.java b/backend/src/main/java/de/szut/casino/user/UserService.java index 25fabef..f74bff9 100644 --- a/backend/src/main/java/de/szut/casino/user/UserService.java +++ b/backend/src/main/java/de/szut/casino/user/UserService.java @@ -1,7 +1,6 @@ package de.szut.casino.user; import de.szut.casino.user.dto.CreateUserDto; -import jakarta.persistence.EntityExistsException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.crypto.password.PasswordEncoder; @@ -20,11 +19,11 @@ public class UserService { public UserEntity createUser(CreateUserDto createUserDto) { if (userRepository.existsByUsername(createUserDto.getUsername())) { - throw new EntityExistsException("Username is already taken"); + throw new IllegalArgumentException("Username is already taken"); } if (userRepository.existsByEmail(createUserDto.getEmail())) { - throw new EntityExistsException("Email is already in use"); + throw new IllegalArgumentException("Email is already in use"); } UserEntity user = new UserEntity( diff --git a/frontend/src/app/feature/auth/register/register.component.html b/frontend/src/app/feature/auth/register/register.component.html index 5339e36..29794c9 100644 --- a/frontend/src/app/feature/auth/register/register.component.html +++ b/frontend/src/app/feature/auth/register/register.component.html @@ -2,11 +2,9 @@