Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
[WEAV-000] 채팅 예외처리 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
waterfogSW committed Apr 12, 2024
1 parent fcb8cc4 commit 2343a82
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ data class SendChatMessageRequest(
val type: ChatMessage.Content.ContentType?,
val value: String?,
) {
init {
require(type != null) { "메시지 타입을 입력해 주세요" }
require(value != null) { "메시지를 입력해 주세요" }
}

fun toDomainContent(): ChatMessage.Content {
requireNotNull(type) { "메시지 타입을 입력해 주세요" }
requireNotNull(value) { "메시지를 입력해 주세요" }

return ChatMessage.Content(
type = type!!,
value = value!!
type = type,
value = value
)
}
}
Expand Down

0 comments on commit 2343a82

Please sign in to comment.