shortCircuit

open override fun shortCircuit(error: Error): Nothing

Throws the given error, immediately short-circuiting the RaiseScope execution.

The thrown exception is caught by fold / folding and passed to their recover lambda. Prefer calling raise at the call site — it is the inline wrapper intended for direct use.

Return

Nothing — always throws.

Parameters

error

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.