I am using 2 classes to handle error statuses, the Spring's own org.springframework.http.HttpStatus
and my custom ErrorStatus
:
enum class ErrorStatus(val code: Int, val reasonPhrase: String) {
ELEMENT_NOT_FOUND(1404, "Element not found"),
UNKNOWN_ERROR(1000, "Unknown Error"),
}
I would like to seal both classes using:
sealed interface Error
It's simple to do this with my class: enum class ErrorStatus(val code: Int, val reasonPhrase: String) : Error {
But is it possible to mark HttpStatus
class as a part of this sealed interface?