Skip to content

Commit

Permalink
[fix] #144 handle HttpMessageNotReadableException in GlobalExceptionH…
Browse files Browse the repository at this point in the history
…andler (#145)
  • Loading branch information
tkdwns414 authored Sep 9, 2024
1 parent d550c95 commit 6090ce6
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.kkumulkkum.server.exception.*;
import org.kkumulkkum.server.exception.code.*;
import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.MissingRequestHeaderException;
Expand Down Expand Up @@ -109,7 +110,11 @@ public ResponseEntity<BusinessErrorCode> handleNoPageFoundException(HttpRequestM
.body(BusinessErrorCode.METHOD_NOT_ALLOWED);
}

@ExceptionHandler(value = {HandlerMethodValidationException.class, MethodArgumentNotValidException.class})
@ExceptionHandler(value = {
HandlerMethodValidationException.class,
MethodArgumentNotValidException.class,
HttpMessageNotReadableException.class
})
public ResponseEntity<BusinessErrorCode> handleValidationException(Exception e) {
log.warn("GlobalExceptionHandler catch MethodArgumentNotValidException : {}", e.getMessage());
return ResponseEntity
Expand Down

0 comments on commit 6090ce6

Please sign in to comment.