diff --git a/main/src/main/java/org/sopt/makers/crew/main/global/advice/ControllerExceptionAdvice.java b/main/src/main/java/org/sopt/makers/crew/main/global/advice/ControllerExceptionAdvice.java index 5b361319..77bed3c7 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/global/advice/ControllerExceptionAdvice.java +++ b/main/src/main/java/org/sopt/makers/crew/main/global/advice/ControllerExceptionAdvice.java @@ -1,8 +1,10 @@ package org.sopt.makers.crew.main.global.advice; +import java.io.IOException; + import org.sopt.makers.crew.main.global.exception.BaseException; -import org.sopt.makers.crew.main.global.exception.ExceptionResponse; import org.sopt.makers.crew.main.global.exception.ErrorStatus; +import org.sopt.makers.crew.main.global.exception.ExceptionResponse; import org.springframework.dao.DataIntegrityViolationException; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -108,6 +110,14 @@ public ResponseEntity handleHttpRequestMethodNotSupportedExce ErrorStatus.INVALID_INPUT_VALUE.getErrorCode())); } + @ExceptionHandler(IOException.class) + public ResponseEntity handleIOException(IOException e) { + log.warn("{}", e.getMessage()); + return ResponseEntity.status(HttpStatus.BAD_REQUEST) + .body(ExceptionResponse.fail( + ErrorStatus.IO_EXCEPTION.getErrorCode())); + } + @ExceptionHandler(Exception.class) public ResponseEntity handleException(Exception e) { log.error("{}", e.getMessage()); @@ -115,5 +125,4 @@ public ResponseEntity handleException(Exception e) { .body(ExceptionResponse.fail( ErrorStatus.INTERNAL_SERVER_ERROR.getErrorCode())); } - } diff --git a/main/src/main/java/org/sopt/makers/crew/main/global/exception/ErrorStatus.java b/main/src/main/java/org/sopt/makers/crew/main/global/exception/ErrorStatus.java index bb4470f8..90e5e61d 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/global/exception/ErrorStatus.java +++ b/main/src/main/java/org/sopt/makers/crew/main/global/exception/ErrorStatus.java @@ -38,6 +38,7 @@ public enum ErrorStatus { CO_LEADER_CANNOT_APPLY("공동 모임장은 신청할 수 없습니다."), LEADER_CANNOT_BE_CO_LEADER_APPLY("모임장은 공동 모임장이 될 수 없습니다."), NOT_ALLOW_MEETING_APPLY("허용되지 않는 모임 신청입니다."), + IO_EXCEPTION("파일 입출력 오류가 발생했습니다."), /** * 401 UNAUTHORIZED