# LibTmux.Control.ScopeFailure

- **Module:** LibTmux.Control
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** exception
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/5bacf40788b43a5af27bb3656e727a921ba2db40/lib/libtmux/control/scope_failure.ex#L1
- **Bases:** [`Exception`](https://elixir.hexdocs.pm/Exception.html)
- **Page:** https://libtmux.org/en/elixir/pr-173/reference/libtmux-control-scopefailure/

A scoped callback finished, but connection cleanup was not proved.

`primary` preserves either `{:return, value}` or
`{:raise, kind, reason, stacktrace}`. `cleanup` holds the separate structured
cleanup error. Callback values stay in the calling process; this wrapper
does not copy them through a bounded connection mailbox or discard them.
See `LibTmux.Control.with_connection/2` for the complete return contract.

## Members

### Other members

- [`primary/1`](/en/elixir/pr-173/reference/libtmux-control-scopefailure-primary-1/) (typealias): The callback's original value or caught exception, throw or exit with its stacktrace.
- [`t/1`](/en/elixir/pr-173/reference/libtmux-control-scopefailure-t-1/) (typealias): Both primary callback evidence and unproved cleanup; neither implies no command effects.

## Guides

Pages that discuss `ScopeFailure`.

- [Read values, execute explicitly](/en/elixir/pr-173/concepts/mental-model/)
