# errors.TmuxServerRestartedError

- **Module:** errors
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-ts/blob/073b9d7dedad900bff6f5ec0ea47794e40225870/packages/libtmux/src/errors.ts#L564
- **Page:** https://libtmux.org/en/ts/latest/reference/errors-tmuxserverrestartederror/

A handle outlived the daemon that issued its id.

tmux numbers a restarted daemon's objects from the start, so `%1` from before
the restart names a pane that exists and belongs to somebody else. Raised
from two places for one reason: the local check, when an acquisition has
already seen the new daemon, and tmux itself, when it has not — the command
carries a condition on the daemon's pid and start time and takes a branch
that refuses instead of running.

[`delivery`](/en/ts/latest/reference/errors-tmuxserverrestartederror-delivery/) is always `not_started`: the whole point of the condition is that
a refused command never ran, so retrying against a fresh handle is safe.

## Examples

```ts
try {
  await pane.kill();
} catch (error) {
  if (error instanceof TmuxServerRestartedError) {
    // Read the server again; this pane's id belongs to another daemon now.
  }
}
```

## Members

### Other members

- [`code`](/en/ts/latest/reference/errors-tmuxserverrestartederror-code/) (attribute)
- [`constructor`](/en/ts/latest/reference/errors-tmuxserverrestartederror-constructor/) (method)
- [`delivery`](/en/ts/latest/reference/errors-tmuxserverrestartederror-delivery/) (attribute): How far the refused command got, which is nowhere.

## Guides

Pages that discuss `TmuxServerRestartedError`.

- [Socket and servers](/en/ts/latest/topics/socket-and-servers/)
