Skip to content

Commit

Permalink
refactor: exception 이름도 같이 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
70825 committed Oct 16, 2023
1 parent 0546c71 commit 89e3bfe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public ReviewNotFoundException(final ReviewErrorCode errorCode, final Long revie
}
}

public static class ReviewSortingOptionNotFoundException extends ReviewException {
public ReviewSortingOptionNotFoundException(final ReviewErrorCode errorCode, final String sortFieldName) {
public static class NotSupportedReviewSortingConditionException extends ReviewException {
public NotSupportedReviewSortingConditionException(final ReviewErrorCode errorCode, final String sortFieldName) {
super(errorCode.getStatus(), new ErrorCode<>(errorCode.getCode(), errorCode.getMessage(), sortFieldName));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import com.funeat.product.domain.Product;
import com.funeat.review.domain.Review;
import com.funeat.review.exception.ReviewException.ReviewSortingOptionNotFoundException;
import com.funeat.review.exception.ReviewException.NotSupportedReviewSortingConditionException;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
Expand Down Expand Up @@ -94,7 +94,7 @@ private static Predicate checkEquals(final String fieldName,
final Long lastReviewField = LongTypeReviewSortSpec.find(fieldName, lastReview);
return criteriaBuilder.equal(reviewPath, lastReviewField);
}
throw new ReviewSortingOptionNotFoundException(NOT_SUPPORTED_REVIEW_SORTING_CONDITION, fieldName);
throw new NotSupportedReviewSortingConditionException(NOT_SUPPORTED_REVIEW_SORTING_CONDITION, fieldName);
}

private static Specification<Review> lessOrGreaterThan(final String field, final String sort,
Expand Down Expand Up @@ -127,7 +127,7 @@ private static Predicate checkGreaterThan(final String fieldName, final Review l
final Long lastReviewField = LongTypeReviewSortSpec.find(fieldName, lastReview);
return criteriaBuilder.greaterThan(reviewPath, lastReviewField);
}
throw new ReviewSortingOptionNotFoundException(NOT_SUPPORTED_REVIEW_SORTING_CONDITION, fieldName);
throw new NotSupportedReviewSortingConditionException(NOT_SUPPORTED_REVIEW_SORTING_CONDITION, fieldName);
}

private static Specification<Review> lessThan(final String fieldName, final Review lastReview) {
Expand Down Expand Up @@ -156,6 +156,6 @@ private static Predicate checkLessThan(final String fieldName, final Review last
final Long lastReviewField = LongTypeReviewSortSpec.find(fieldName, lastReview);
return criteriaBuilder.lessThan(reviewPath, lastReviewField);
}
throw new ReviewSortingOptionNotFoundException(NOT_SUPPORTED_REVIEW_SORTING_CONDITION, fieldName);
throw new NotSupportedReviewSortingConditionException(NOT_SUPPORTED_REVIEW_SORTING_CONDITION, fieldName);
}
}

0 comments on commit 89e3bfe

Please sign in to comment.