tmux_scope:run_or_error/2
Run work and cleanup with run/2, returning the callback value directly. Raises {scope_cleanup_failed, Failure} if cleanup fails, retaining both outcomes in failure/0. With successful cleanup, callback exceptions retain their original reason and stack. Nested raising scopes propagate an inner failure through the outer scope while still attempting outer cleanup.
Source and package
- Qualified name
-
tmux_scope: run _or _error/2 - Declared in
tmux_scope- Package
- libtmux_erlang
- Source
- apps/libtmux_erlang/src/tmux_scope.erl
- run_or_error(Function, Cleanup) -spec run_or_error(fun(() -> Value), fun(() -> ok | {error, term()})) -> Value.
Guides#
Pages that discuss run_or_error/2.