From af5c0202ee2ab54741070df7c48b99983f5d83a0 Mon Sep 17 00:00:00 2001 From: Hyeonji <110809927+skylar1220@users.noreply.github.com> Date: Sun, 27 Oct 2024 15:32:27 +0900 Subject: [PATCH] =?UTF-8?q?[BE]=20=EC=98=88=EC=99=B8=EC=9D=98=20=EC=9E=98?= =?UTF-8?q?=EB=AA=BB=EB=90=9C=20=EB=A1=9C=EA=B7=B8=EB=A0=88=EB=B2=A8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EB=B0=8F=20=EC=82=AC=EC=9A=A9=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EC=98=88=EC=99=B8=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0=20(#951)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 로그 레벨 info로 조정 * refactor: 사용하지 않는 예외 삭제 --- .../HighlightStartIndexExceedEndIndexException.java | 13 ------------- .../MissingTextAnswerForQuestionException.java | 13 ------------- .../exception/AnswerNotFoundByIdException.java | 13 ------------- .../exception/InvalidTextAnswerLengthException.java | 2 +- ...uestionAndProvidedQuestionMismatchException.java | 6 ------ 5 files changed, 1 insertion(+), 46 deletions(-) delete mode 100644 backend/src/main/java/reviewme/highlight/domain/exception/HighlightStartIndexExceedEndIndexException.java delete mode 100644 backend/src/main/java/reviewme/review/domain/exception/MissingTextAnswerForQuestionException.java delete mode 100644 backend/src/main/java/reviewme/review/service/exception/AnswerNotFoundByIdException.java diff --git a/backend/src/main/java/reviewme/highlight/domain/exception/HighlightStartIndexExceedEndIndexException.java b/backend/src/main/java/reviewme/highlight/domain/exception/HighlightStartIndexExceedEndIndexException.java deleted file mode 100644 index 38c99ac9a..000000000 --- a/backend/src/main/java/reviewme/highlight/domain/exception/HighlightStartIndexExceedEndIndexException.java +++ /dev/null @@ -1,13 +0,0 @@ -package reviewme.highlight.domain.exception; - -import lombok.extern.slf4j.Slf4j; -import reviewme.global.exception.BadRequestException; - -@Slf4j -public class HighlightStartIndexExceedEndIndexException extends BadRequestException { - - public HighlightStartIndexExceedEndIndexException(int startIndex, int endIndex) { - super("하이라이트 끝 위치는 시작 위치보다 같거나 커야 해요."); - log.info("Highlight start index exceed end index - startIndex: {}, endIndex: {}", startIndex, endIndex); - } -} diff --git a/backend/src/main/java/reviewme/review/domain/exception/MissingTextAnswerForQuestionException.java b/backend/src/main/java/reviewme/review/domain/exception/MissingTextAnswerForQuestionException.java deleted file mode 100644 index 674dce41c..000000000 --- a/backend/src/main/java/reviewme/review/domain/exception/MissingTextAnswerForQuestionException.java +++ /dev/null @@ -1,13 +0,0 @@ -package reviewme.review.domain.exception; - -import lombok.extern.slf4j.Slf4j; -import reviewme.global.exception.DataInconsistencyException; - -@Slf4j -public class MissingTextAnswerForQuestionException extends DataInconsistencyException { - - public MissingTextAnswerForQuestionException(long questionId) { - super("서버 내부에 문제가 발생했습니다. 잠시 후 다시 시도해주세요."); - log.error("The question is a text question but text answer not found for questionId: {}", questionId, this); - } -} diff --git a/backend/src/main/java/reviewme/review/service/exception/AnswerNotFoundByIdException.java b/backend/src/main/java/reviewme/review/service/exception/AnswerNotFoundByIdException.java deleted file mode 100644 index aef381ffc..000000000 --- a/backend/src/main/java/reviewme/review/service/exception/AnswerNotFoundByIdException.java +++ /dev/null @@ -1,13 +0,0 @@ -package reviewme.review.service.exception; - -import lombok.extern.slf4j.Slf4j; -import reviewme.global.exception.NotFoundException; - -@Slf4j -public class AnswerNotFoundByIdException extends NotFoundException { - - public AnswerNotFoundByIdException(long answerId) { - super("답변을 찾을 수 없어요."); - log.info("Answer not found by id - answerId: {}", answerId); - } -} diff --git a/backend/src/main/java/reviewme/review/service/exception/InvalidTextAnswerLengthException.java b/backend/src/main/java/reviewme/review/service/exception/InvalidTextAnswerLengthException.java index 01c02ceb7..314f72673 100644 --- a/backend/src/main/java/reviewme/review/service/exception/InvalidTextAnswerLengthException.java +++ b/backend/src/main/java/reviewme/review/service/exception/InvalidTextAnswerLengthException.java @@ -8,7 +8,7 @@ public class InvalidTextAnswerLengthException extends BadRequestException { public InvalidTextAnswerLengthException(long questionId, int answerLength, int minLength, int maxLength) { super("답변의 길이는 %d자 이상 %d자 이하여야 해요.".formatted(minLength, maxLength)); - log.warn("AnswerLength is out of bound - questionId: {}, answerLength: {}, minLength: {}, maxLength: {}", + log.info("AnswerLength is out of bound - questionId: {}, answerLength: {}, minLength: {}, maxLength: {}", questionId, answerLength, minLength, maxLength, this); } diff --git a/backend/src/main/java/reviewme/review/service/exception/SubmittedQuestionAndProvidedQuestionMismatchException.java b/backend/src/main/java/reviewme/review/service/exception/SubmittedQuestionAndProvidedQuestionMismatchException.java index 1924b1cf5..97b0f77d9 100644 --- a/backend/src/main/java/reviewme/review/service/exception/SubmittedQuestionAndProvidedQuestionMismatchException.java +++ b/backend/src/main/java/reviewme/review/service/exception/SubmittedQuestionAndProvidedQuestionMismatchException.java @@ -1,7 +1,6 @@ package reviewme.review.service.exception; import java.util.Collection; -import java.util.List; import lombok.extern.slf4j.Slf4j; import reviewme.global.exception.BadRequestException; @@ -16,9 +15,4 @@ public SubmittedQuestionAndProvidedQuestionMismatchException(Collection su submittedQuestionIds, providedQuestionIds, this ); } - - public SubmittedQuestionAndProvidedQuestionMismatchException(long submittedQuestionId, - Collection providedQuestionIds) { - this(List.of(submittedQuestionId), providedQuestionIds); - } }