raise

Raise a JVM exception when a condition cannot be accepted.

Example.kalm kalm
pub fun positive(value: Int) -> Int:
    if value < 1:
        raise java.lang.IllegalArgumentException("Expected a positive value")
    return value

Learn more.