# error.refusal.Error.refused

- **Module:** error.refusal.Error
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/error/refusal.rs#L41
- **Page:** https://libtmux.org/reference/rs/error-refusal-error-refused/

```
error.refusal.Error.refused(command: &'static str, exit_code: Option<i32>, stderr: String, target: Option<&std::ffi::OsStr>) -> Self
```

Classify a refused tmux command, recognizing a target that has gone.

tmux reports a missing target as `can't find <kind>: <target>` and
exits 1, the same status it uses for an argument it did not like, so
the message is the only thing that separates them. It is not
localized -- tmux has no message catalogue -- and the wording has been
stable across every supported release.

Anything that does not match stays a refusal, so a future rewording
costs the distinction rather than correctness.
`target` is the request's own `-t`, when it had one. tmux reports a
server holding no sessions as `no current target` even for a target it
was given, so the request is what recovers the name.
