Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed Feb 1, 2024
1 parent 0b75ac3 commit 86bb9a3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.bind.support.WebExchangeBindException;
import reactor.core.publisher.Mono;

@RestControllerAdvice
Expand All @@ -20,8 +21,8 @@ public Mono<ResponseEntity<ErrorResponse>> handleGlobalException(CustomException
.body(errorResponse));
}

@ExceptionHandler(MethodArgumentNotValidException.class)
public Mono<ResponseEntity<ErrorResponse>> handleValidException(MethodArgumentNotValidException e) {
@ExceptionHandler(WebExchangeBindException.class)
public Mono<ResponseEntity<ErrorResponse>> handleValidException(WebExchangeBindException e) {
FieldError fieldError = e.getBindingResult().getFieldError();
int status = HttpStatus.BAD_REQUEST.value();
String message = fieldError != null ? fieldError.getDefaultMessage() : "Bad Request";
Expand Down

0 comments on commit 86bb9a3

Please sign in to comment.