@@ -8,10 +8,8 @@ import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
import ru.soune.no_copy.dto.MessageCode;
|
||||
import ru.soune.no_copy.exception.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
@RestControllerAdvice
|
||||
@@ -31,9 +29,9 @@ public class GlobalExceptionHandler {
|
||||
"message" ,message));
|
||||
}
|
||||
|
||||
@ExceptionHandler(UserAlreadyExistsException.class)
|
||||
@ExceptionHandler(NotValidFieldException.class)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public ResponseEntity<?> handleUserContainsException(UserAlreadyExistsException ex) {
|
||||
public ResponseEntity<?> handleUserContainsException(NotValidFieldException ex) {
|
||||
|
||||
return ResponseEntity
|
||||
.ok()
|
||||
|
||||
Reference in New Issue
Block a user