Class CommonExceptionHandler


  • @ControllerAdvice
    @Order(-2147483648)
    public class CommonExceptionHandler
    extends java.lang.Object
    공통적으로 발생하는 Exception Handler.
    Version:
    1.0
    Author:
    always0ne
    • Constructor Detail

      • CommonExceptionHandler

        public CommonExceptionHandler()
    • Method Detail

      • handleNotYours

        @ExceptionHandler(ThisIsNotYoursException.class)
        @ResponseStatus(BAD_REQUEST)
        @ResponseBody
        public ErrorResponse handleNotYours​(ThisIsNotYoursException exception)
        존재하지 않거나 본인 소유가 아닌 컨텐츠 수정 요청 발생.
        Parameters:
        exception - 수정권한이 없습니다.
        Returns:
        FORBIDDEN
      • handleNotYours

        @ExceptionHandler(org.springframework.http.converter.HttpMessageNotReadableException.class)
        @ResponseStatus(BAD_REQUEST)
        @ResponseBody
        public ErrorResponse handleNotYours​(org.springframework.http.converter.HttpMessageNotReadableException exception)
        형식에 맞지 않는 BODY요청이 왔을 때.
        Parameters:
        exception - 잘못된 데이터입니다.
        Returns:
        BAD_REQUEST