error
Stops normal execution by throwing an IllegalStateException.
The return type Nothing allows this call in any expression that needs a value.
val value = candidate ?: error("Missing value")Content copied to clipboard
Parameters
message
description of the invalid state.
Throws
always, with message as its detail message.