From 793eee809696ac926d4c0738f60c4f6072f958dd Mon Sep 17 00:00:00 2001 From: whqtker Date: Wed, 24 Jun 2026 21:27:00 +0900 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20CustomException=EC=9D=80=20?= =?UTF-8?q?=EC=9D=B4=EC=A4=91=20=EB=9E=98=ED=95=91=ED=95=98=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EA=B3=A0=20=EB=8D=98=EC=A7=80=EB=8F=84=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../solidconnection/cache/ThunderingHerdCachingAspect.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/example/solidconnection/cache/ThunderingHerdCachingAspect.java b/src/main/java/com/example/solidconnection/cache/ThunderingHerdCachingAspect.java index 6f0abc7f2..22652b1c1 100644 --- a/src/main/java/com/example/solidconnection/cache/ThunderingHerdCachingAspect.java +++ b/src/main/java/com/example/solidconnection/cache/ThunderingHerdCachingAspect.java @@ -7,6 +7,7 @@ import com.example.solidconnection.cache.annotation.ThunderingHerdCaching; import com.example.solidconnection.cache.manager.CacheManager; +import com.example.solidconnection.common.exception.CustomException; import com.example.solidconnection.util.RedisUtils; import java.time.Duration; import java.util.UUID; @@ -114,6 +115,8 @@ private Object executeWithLock(String lockKey, Callable onLockAcquired, } else { return onLockFailed.call(); } + } catch (CustomException e) { + throw e; } catch (Exception e) { throw new RuntimeException("Error during executeWithLock", e); } finally { @@ -150,6 +153,8 @@ private Object waitForCacheToUpdate(ProceedingJoinPoint joinPoint, String key) { private Object proceedJoinPoint(ProceedingJoinPoint joinPoint) { try { return joinPoint.proceed(); + } catch (CustomException e) { + throw e; } catch (Throwable e) { throw new RuntimeException("Error during proceedJoinPoint", e); } From b0079ad7a02c55ec32e09aaad54fc7ea5b513ea8 Mon Sep 17 00:00:00 2001 From: whqtker Date: Wed, 24 Jun 2026 21:43:35 +0900 Subject: [PATCH 2/2] =?UTF-8?q?test:=20=EC=A1=B4=EC=9E=AC=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EB=8C=80=ED=95=99=EC=9D=84=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=ED=95=98=EB=8A=94=20=EA=B2=BD=EC=9A=B0=20Cus?= =?UTF-8?q?tomException=EC=9D=84=20=EA=B8=B0=EB=8C=80=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../university/service/UnivApplyInfoQueryServiceTest.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/test/java/com/example/solidconnection/university/service/UnivApplyInfoQueryServiceTest.java b/src/test/java/com/example/solidconnection/university/service/UnivApplyInfoQueryServiceTest.java index f39762ba8..c914aab65 100644 --- a/src/test/java/com/example/solidconnection/university/service/UnivApplyInfoQueryServiceTest.java +++ b/src/test/java/com/example/solidconnection/university/service/UnivApplyInfoQueryServiceTest.java @@ -83,10 +83,8 @@ class 대학_지원_정보_상세_조회 { Long invalidUnivApplyInfoId = 9999L; // when & then - assertThatExceptionOfType(RuntimeException.class) + assertThatExceptionOfType(CustomException.class) .isThrownBy(() -> univApplyInfoQueryService.getUnivApplyInfoDetail(invalidUnivApplyInfoId)) - .havingRootCause() - .isInstanceOf(CustomException.class) .withMessage(UNIV_APPLY_INFO_NOT_FOUND.getMessage()); } }