raise

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

Evaluates error and delegates to shortCircuit, immediately short-circuiting the RaiseScope execution.

This is the primary way to raise an error from within a scope block.

Return

Nothing — always throws.

Parameters

error

Produces the error value to raise.

Throws

RaisedException

nz.adjmunro.outcome.raise.RaisedException while the scope is active.

RaiseScopeLeakedException

nz.adjmunro.outcome.raise.RaiseScopeLeakedException if close has already been called.