Skip to content

Commit

Permalink
fix: exception advice logging 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
gengminy committed Dec 12, 2023
1 parent 358475c commit c693b58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/testcar/car/config/ExceptionAdvice.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class ExceptionAdvice {
@ExceptionHandler(HttpMessageNotReadableException.class)
protected ResponseEntity<ErrorResponse> handleMissingServletRequestParameterException(
HttpMessageNotReadableException e) {
log.warn("HttpMessageNotReadableException. error message: request field error");
log.warn("HttpMessageNotReadableException. error message: request field error", e);
final BadRequestException exception = new BadRequestException(BAD_REQUEST);
final ErrorResponse response = ErrorResponse.from(exception);
return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST);
Expand All @@ -34,7 +34,7 @@ protected ResponseEntity<ErrorResponse> handleMissingServletRequestParameterExce
@ExceptionHandler(MissingServletRequestParameterException.class)
protected ResponseEntity<ErrorResponse> handleMissingServletRequestParameterException(
MissingServletRequestParameterException e) {
log.warn("MissingServletRequestParameterException. error message: request field error");
log.warn("MissingServletRequestParameterException. error message: request field error", e);
final BadRequestException exception = new BadRequestException(BAD_REQUEST);
final ErrorResponse response = ErrorResponse.from(exception);
return new ResponseEntity<>(response, e.getStatusCode());
Expand All @@ -44,7 +44,7 @@ protected ResponseEntity<ErrorResponse> handleMissingServletRequestParameterExce
@ExceptionHandler(MethodArgumentNotValidException.class)
protected ResponseEntity<ErrorResponse> handleMethodArgumentNotValidException(
MethodArgumentNotValidException e) {
log.warn("MethodArgumentNotValidException. error message: request field error");
log.warn("MethodArgumentNotValidException. error message: request field error", e);
final BadRequestException exception = new BadRequestException(BAD_REQUEST);
final ErrorResponse response = ErrorResponse.of(exception, e.getBindingResult());
return new ResponseEntity<>(response, e.getStatusCode());
Expand Down

0 comments on commit c693b58

Please sign in to comment.