diff --git a/module-common/src/main/java/com/mile/exception/message/ErrorMessage.java b/module-common/src/main/java/com/mile/exception/message/ErrorMessage.java index 3347fc6a..85f26d86 100644 --- a/module-common/src/main/java/com/mile/exception/message/ErrorMessage.java +++ b/module-common/src/main/java/com/mile/exception/message/ErrorMessage.java @@ -87,6 +87,7 @@ public enum ErrorMessage { IMAGE_DELETE_ERROR(HttpStatus.INTERNAL_SERVER_ERROR.value(), "S3 버킷으로부터 이미지를 삭제하는 데 실패했습니다."), INTERNAL_SERVER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR.value(), "서버 내부 오류입니다."), DISCORD_LOG_APPENDER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR.value(), "디스코드 로그 전송에 실패하였습니다"), + TIME_OUT_EXCEPTION(HttpStatus.INTERNAL_SERVER_ERROR.value(), "락을 획득하는 과정에서 Time Out이 발생했습니다."), ; final int status; diff --git a/module-domain/src/main/java/com/mile/moim/service/lock/MoimNameRequestAspect.java b/module-domain/src/main/java/com/mile/moim/service/lock/MoimNameRequestAspect.java index fc4384d4..719b6ed6 100644 --- a/module-domain/src/main/java/com/mile/moim/service/lock/MoimNameRequestAspect.java +++ b/module-domain/src/main/java/com/mile/moim/service/lock/MoimNameRequestAspect.java @@ -1,5 +1,7 @@ package com.mile.moim.service.lock; +import com.mile.exception.message.ErrorMessage; +import com.mile.exception.model.MileException; import lombok.RequiredArgsConstructor; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; @@ -38,7 +40,7 @@ public Object validateUniqueName(final ProceedingJoinPoint joinPoint) throws Thr } public void checkAvailability(final Boolean available) { - if (!available) throw new RuntimeException("Lock is Unavailable"); + if (!available) throw new MileException(ErrorMessage.TIME_OUT_EXCEPTION); } }