raise

inline fun <Error : Any> RaiseScope<Error>.raise(error: () -> Error): Nothing

Invokes error, wraps it as a Throwable and then throws it, short-circuiting the RaiseScope execution.

Return

Nothing This function always throws.

Parameters

error

The error to raise, which can be any non-null type.

See also

Throws

RaiseCancellationException

When RaiseScope is active.

RaiseScopeLeakedException

If RaiseScope.complete has already been called.