Default Raise Scope
Default implementation of RaiseScope.
Tracks scope lifetime with an atomic flag. While active, shortCircuit throws RaisedException. After close is called, it throws RaiseScopeLeakedException instead, indicating the scope has been used beyond its intended lifetime.
Prefer using a builder such as outcomeOf or faultOf rather than constructing a DefaultRaiseScope directly. Construct one manually only when you need to own the scope lifecycle yourself.
Parameters
The type of error that can be raised.
See also
Functions
Executes block inside the current RaiseScope, converting any thrown Throwable — including fatal kotlin.Error subclasses — to a raised Error via catch.
Executes block inside the current RaiseScope, converting any thrown Throwable — including fatal kotlin.Error subclasses — to a raised Error via catch.
Suspend variant of fold that propagates CancellationException for structured concurrency.
Type-hint helper — tells the compiler the Error type of this RaiseScope is Nothing. Use when type inference fails and no error can ever be raised.
Evaluates error and delegates to shortCircuit, immediately short-circuiting the RaiseScope execution.
Type-hint helper — tells the compiler the Error type of this RaiseScope. Use when type inference fails and no value is available to infer from.
Type-hint helper — tells the compiler the Error type of this RaiseScope using a concrete type value. Use when type inference fails and a representative value is available.
Throws the given error, immediately short-circuiting the RaiseScope execution.