From 31a549f60088a24ebb6426a9511aef0813f76b37 Mon Sep 17 00:00:00 2001 From: ITQ Date: Sat, 18 Apr 2026 12:04:33 +0300 Subject: [PATCH] feat(domain): added domain exceptions --- .../movienight/domain/exception/BlockedValueException.kt | 6 ++++++ .../project/movienight/domain/exception/DomainException.kt | 5 +++++ .../movienight/domain/exception/EntityNotFoundException.kt | 6 ++++++ 3 files changed, 17 insertions(+) create mode 100644 src/main/kotlin/com/project/movienight/domain/exception/BlockedValueException.kt create mode 100644 src/main/kotlin/com/project/movienight/domain/exception/DomainException.kt create mode 100644 src/main/kotlin/com/project/movienight/domain/exception/EntityNotFoundException.kt diff --git a/src/main/kotlin/com/project/movienight/domain/exception/BlockedValueException.kt b/src/main/kotlin/com/project/movienight/domain/exception/BlockedValueException.kt new file mode 100644 index 0000000..7555c0c --- /dev/null +++ b/src/main/kotlin/com/project/movienight/domain/exception/BlockedValueException.kt @@ -0,0 +1,6 @@ +package com.project.movienight.domain.exception + +class BlockedValueException( + target: String, + field: String, +) : DomainException("$target with this $field is not acceptable") diff --git a/src/main/kotlin/com/project/movienight/domain/exception/DomainException.kt b/src/main/kotlin/com/project/movienight/domain/exception/DomainException.kt new file mode 100644 index 0000000..aaa5dd4 --- /dev/null +++ b/src/main/kotlin/com/project/movienight/domain/exception/DomainException.kt @@ -0,0 +1,5 @@ +package com.project.movienight.domain.exception + +open class DomainException( + message: String, +) : RuntimeException(message) diff --git a/src/main/kotlin/com/project/movienight/domain/exception/EntityNotFoundException.kt b/src/main/kotlin/com/project/movienight/domain/exception/EntityNotFoundException.kt new file mode 100644 index 0000000..bce42d0 --- /dev/null +++ b/src/main/kotlin/com/project/movienight/domain/exception/EntityNotFoundException.kt @@ -0,0 +1,6 @@ +package com.project.movienight.domain.exception + +class EntityNotFoundException( + entity: String, + id: String, +) : DomainException("$entity with id $id not found")