Raise Scope
A scope for raising errors.
Use default context runner to create a new RaiseScope. Within the scope, the raise method can be called to throw any Error as if it were a Throwable and in doing so, short-circuit the scope execution.
See also
Inheritors
Functions
Link copied to clipboard
inline fun <Ok, Error : Any> RaiseScope<Error>.catch(catch: (throwable: Throwable) -> Error = ::rethrow, block: RaiseScope<Error>.() -> Ok): Ok
A context runner use inside the RaiseScope when you wish to catch an expected (non-fatal) Throwable and convert it to an Error from your domain.
Link copied to clipboard