From bba896efe9d4e49645369274621688e1a1ae90b8 Mon Sep 17 00:00:00 2001 From: gurdl7011 Date: Fri, 20 Oct 2023 20:23:26 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20::=20Exception?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/highthon/domain/auth/service/SmsServiceImpl.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/example/highthon/domain/auth/service/SmsServiceImpl.kt b/src/main/kotlin/com/example/highthon/domain/auth/service/SmsServiceImpl.kt index bd7fc9f..99559d1 100644 --- a/src/main/kotlin/com/example/highthon/domain/auth/service/SmsServiceImpl.kt +++ b/src/main/kotlin/com/example/highthon/domain/auth/service/SmsServiceImpl.kt @@ -6,6 +6,7 @@ import com.example.highthon.domain.auth.exception.* import com.example.highthon.domain.auth.presentation.dto.request.PhoneNumberSmsRequest import com.example.highthon.domain.auth.presentation.dto.request.SignUpSmsRequest import com.example.highthon.domain.auth.repository.QualificationRepository +import com.example.highthon.domain.user.exception.UserNotFoundException import com.example.highthon.domain.user.repository.UserRepository import com.example.highthon.global.env.sms.SmsProperty import mu.KLogger @@ -88,7 +89,7 @@ class SmsServiceImpl( @Transactional override fun sendPhoneNumberMessage(req: PhoneNumberSmsRequest): SingleMessageSentResponse? { - if (!userRepository.existsByPhoneNumber(req.phoneNumber!!)) throw PhoneNumberNotExistException + if (!userRepository.existsByPhoneNumber(req.phoneNumber!!)) throw UserNotFoundException if (qualificationRepository.existsById(req.phoneNumber)) throw AlreadyPostedMessageException