Skip to content

Commit

Permalink
add: (#78) 이메일 인증 정책 예외
Browse files Browse the repository at this point in the history
  • Loading branch information
khcho0125 committed Sep 25, 2022
1 parent 20c1e5a commit 8596c78
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ enum class AuthErrorCode(
): ErrorProperty {

// 401
AUTHCODE_NOT_FOUND(401, "인증 코드를 찾을 수 없음"),
UNCERTIFIED_EMAIL(401, "인증되지 않은 이메일"),
REFRESH_TOKEN_NOT_FOUND(401, "토큰을 찾을 수 없음"),

// 409
ALREADY_USED_EMAIL(409, "이미 사용된 이메일");
ALREADY_USED_EMAIL(409, "이미 사용된 이메일"),
ALREADY_CERTIFIED_EMAIL(409, "이미 인증된 이메일"),

// 429
EXCEEDED_SEND_AUTHCODE_REQUEST(429, "인증 코드 발송 횟수 초과");

override fun message(): String = message
override fun status(): Int = status
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package team.comit.simtong.domain.auth.exception

import team.comit.simtong.domain.auth.error.AuthErrorCode
import team.comit.simtong.global.error.BusinessException

/**
*
* AuthCode Not Found Error를 발생시키는 AuthCodeNotFoundException
*
* @author Chokyunghyeon
* @date 2022/09/25
* @version 1.0.0
**/
class AuthCodeNotFoundException private constructor(): BusinessException(AuthErrorCode.AUTHCODE_NOT_FOUND) {

companion object {
@JvmField
val EXCEPTION = AuthCodeNotFoundException()
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package team.comit.simtong.domain.auth.exception

import team.comit.simtong.domain.auth.error.AuthErrorCode
import team.comit.simtong.global.error.BusinessException

/**
*
* Already Certified Email Error를 발생시키는 CertifiedEmailException
*
* @author Chokyunghyeon
* @date 2022/09/24
* @version 1.0.0
**/
class CertifiedEmailException private constructor(): BusinessException(AuthErrorCode.ALREADY_CERTIFIED_EMAIL) {

companion object {
@JvmField
val EXCEPTION = CertifiedEmailException()
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package team.comit.simtong.domain.auth.exception

import team.comit.simtong.domain.auth.error.AuthErrorCode
import team.comit.simtong.global.error.BusinessException

/**
*
* Exceeded Send AuthCode Request Error를 발생시키는 ExceededSendAuthCodeRequestException
*
* @author Chokyunghyeon
* @date 2022/09/24
* @version 1.0.0
**/
class ExceededSendAuthCodeRequestException private constructor(): BusinessException(AuthErrorCode.EXCEEDED_SEND_AUTHCODE_REQUEST) {

companion object {
@JvmField
val EXCEPTION = ExceededSendAuthCodeRequestException()
}

}

0 comments on commit 8596c78

Please sign in to comment.