# error.Error.kind

- **Module:** error.Error
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/error/classification.rs#L63
- **Page:** https://libtmux.org/en/rs/latest/reference/error-error-kind/

```
error.Error.kind(self) -> ErrorKind
```

Return what this failure means for the caller.

## Example

```rust
use libtmux::ErrorKind;

// The shape this exists for: use it if it is there, make it if not.
let session = match server.session("work").await? {
    Some(session) => session,
    None => server.new_session("work").await?,
};

// And when an operation races something else removing it. The handle
// is cloned because killing consumes one, which is how the crate
// stops you from using a window you just destroyed.
let window = session.new_window("doomed").await?;
let mut stale = window.clone();
window.kill().await?;

let error = stale.rename("gone").await.expect_err("the window was killed");
assert_eq!(error.kind(), ErrorKind::ObjectGone);
assert!(error.is_object_gone());
```
