[#20] 도메인별 예외 분리 #21

Merged
pricelees merged 37 commits from refactor/#20 into main 2025-07-24 02:48:53 +00:00
3 changed files with 35 additions and 0 deletions
Showing only changes of commit 7c30100f5a - Show all commits

View File

@ -0,0 +1,20 @@
package roomescape.common.exception
import org.springframework.http.HttpStatus
enum class CommonErrorCode(
override val httpStatus: HttpStatus,
override val errorCode: String,
override val message: String,
) : ErrorCode {
INVALID_INPUT_VALUE(
httpStatus = HttpStatus.BAD_REQUEST,
errorCode = "C001",
message = "요청 값이 잘못되었어요."
),
UNEXPECTED_SERVER_ERROR(
httpStatus = HttpStatus.INTERNAL_SERVER_ERROR,
errorCode = "C999",
message = "서버에 예상치 못한 오류가 발생했어요. 관리자에게 문의해주세요.",
),
}

View File

@ -0,0 +1,9 @@
package roomescape.common.exception
import org.springframework.http.HttpStatus
interface ErrorCode {
val httpStatus: HttpStatus
val errorCode: String
val message: String
}

View File

@ -0,0 +1,6 @@
package roomescape.common.exception
open class RoomException(
open val errorCode: ErrorCode,
override val message: String? = errorCode.message
) : RuntimeException(message)