kotlin throw code example
Example 1: Kotlin throws
@Throws(SomeException::class)
fun raise() {
throw SomeException("Mwehp!")
}
Example 2: kotlin throw exception
throw Exception("Exception message")
@Throws(SomeException::class)
fun raise() {
throw SomeException("Mwehp!")
}
throw Exception("Exception message")