Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.springframework.validation.FieldError;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.MissingRequestHeaderException;
import org.springframework.web.bind.MissingServletRequestParameterException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
Expand Down Expand Up @@ -109,6 +110,18 @@ public ResponseEntity<RsData<Void>> handle(MissingRequestHeaderException ex) {
);
}

@ExceptionHandler(MissingServletRequestParameterException.class)
public ResponseEntity<RsData<Void>> handle(MissingServletRequestParameterException ex) {
String message = String.format("필수 파라미터 '%s'(이)가 누락되었습니다.", ex.getParameterName());
return new ResponseEntity<>(
new RsData<>(
"400-1",
message
),
BAD_REQUEST
);
}

// @PreAuthorize 권한 에러
@ExceptionHandler(AuthorizationDeniedException.class)
public ResponseEntity<RsData<Void>> handle(AuthorizationDeniedException ex) {
Expand Down