HttpStatus
data class HttpStatus(val code: Int, val type: HttpStatusType = when (code) {
in 100..199 -> INFORMATION
in 200..299 -> SUCCESS
in 300..399 -> REDIRECTION
in 400..499 -> CLIENT_ERROR
in 500..599 -> SERVER_ERROR
else -> throw IllegalArgumentException(INVALID_CODE_ERROR_MESSAGE + code)
})
Constructors
Link copied to clipboard
constructor(code: Int, type: HttpStatusType = when (code) {
in 100..199 -> INFORMATION
in 200..299 -> SUCCESS
in 300..399 -> REDIRECTION
in 400..499 -> CLIENT_ERROR
in 500..599 -> SERVER_ERROR
else -> throw IllegalArgumentException(INVALID_CODE_ERROR_MESSAGE + code)
})