# tmux_error

- **Package:** libtmux_erlang
- **Language:** Erlang
- **Kind:** module
- **Source:** https://github.com/libtmux/libtmux-erlang/blob/d1b6308440cf9eb8f6647e7ae434bce60e849368/apps/libtmux_erlang/src/tmux_error.erl#L1
- **Page:** https://libtmux.org/en/erlang/latest/reference/tmux_error/

Explain library exceptions through Erlang's native error formatter.

The shell and `erl_error:format_exception/3` call `format_error/2` through
EEP-54 stack metadata. Explanations supplement the original exception reason;
tagged results from `tmux_filter:new/2` and `tmux_select:try_where/2` retain
their existing structured data. Formatting performs no tmux I/O.

Only library-raised errors carry this metadata. Application callback failures
retain their original class, reason and stack. Coverage errors describe missing
observations; formatting never loads those observations or retries an action.
Long detail values may be abbreviated in the explanation. The exception reason
retains the original error data. See [runtime diagnostics](diagnostics.md) for
the separate, bounded Logger report contract.

## Members

### Common operations

- [`format_error/2`](/en/erlang/latest/reference/tmux_error-format_error-2/) (function): Return supplemental native error text, or an empty map for an unknown reason.

## Guides

Pages that discuss `tmux_error`.

### Guides

- [Native API documentation](/en/erlang/latest/guides/api-documentation/)

### Topics

- [Diagnostics](/en/erlang/latest/topics/diagnostics/)
