error
Throws an IllegalStateException with the given message.
Samples
import samples.*
import kotlin.test.*
fun main() {
//sampleStart
val name: String? = null
assertFailsWith<IllegalStateException> { val nonNullName = name ?: error("Name is missing") }
//sampleEnd
}