Skip to content

Commit

Permalink
[BE] feat: InvalidMediaTypeException 예외 핸들링 (#439) (#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
seokjin8678 authored and BGuga committed Oct 17, 2023
1 parent 4debcdf commit ad2779e
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.slf4j.Logger;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.InvalidMediaTypeException;
import org.springframework.http.HttpStatusCode;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.MethodArgumentNotValidException;
Expand Down Expand Up @@ -59,6 +60,11 @@ public GlobalExceptionHandler(AuthenticateContext authenticateContext, Logger er
this.errorLogger = errorLogger;
}

@ExceptionHandler(InvalidMediaTypeException.class)
public ResponseEntity<ErrorResponse> handle(InvalidMediaTypeException e) {
return ResponseEntity.badRequest().build();
}

@ExceptionHandler(BadRequestException.class)
public ResponseEntity<ErrorResponse> handle(BadRequestException e, HttpServletRequest request) {
logInfo(e, request);
Expand Down

0 comments on commit ad2779e

Please sign in to comment.