# LibTmux.FSharp.Control.cleanupFailure

- **Module:** LibTmux.FSharp
- **Package:** LibTmux.FSharp
- **Language:** F#
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux.FSharp/Control.fsi#L114
- **Page:** https://libtmux.org/en/fsharp/latest/reference/libtmux-fsharp-control-cleanupfailure/

```
val cleanupFailure: error: exn -> exn option
```

Returns the cleanup failure attached to the exception a helper rethrew.

When work and cleanup both fail, the helpers rethrow the work's exception
unchanged and attach the cleanup's; this reads it back. The work's
exception keeps its type so that a handler written for it, such as
<c>:? TmuxPaneException</c> or a <c>when</c> filter, still matches;
an <c>AggregateException</c> of both would slip past those handlers.

## Parameters

- `error` (`exn`)
