feat: 일정 관련 커스텀 예외 및 에러코드 정의

This commit is contained in:
이상진 2025-09-04 11:33:39 +09:00
parent b8e9c38024
commit 9409d24983
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,15 @@
package roomescape.schedule.exception
import org.springframework.http.HttpStatus
import roomescape.common.exception.ErrorCode
enum class ScheduleErrorCode(
override val httpStatus: HttpStatus,
override val errorCode: String,
override val message: String
) : ErrorCode {
SCHEDULE_NOT_FOUND(HttpStatus.NOT_FOUND, "S001", "일정을 찾을 수 없어요."),
SCHEDULE_ALREADY_EXISTS(HttpStatus.CONFLICT, "S002", "이미 동일한 일정이 있어요."),
PAST_DATE_TIME(HttpStatus.BAD_REQUEST, "S003", "과거 날짜와 시간은 선택할 수 없어요."),
SCHEDULE_IN_USE(HttpStatus.CONFLICT, "S004", "예약이 진행중이거나 완료된 일정은 삭제할 수 없어요."),
}

View File

@ -0,0 +1,7 @@
import roomescape.common.exception.ErrorCode
import roomescape.common.exception.RoomescapeException
class ScheduleException(
override val errorCode: ErrorCode,
override val message: String = errorCode.message
) : RoomescapeException(errorCode, message)