# catchCause

Recovers from any failure cause by running a fallback Fx.

## Signatures

```ts
export declare const catchCause: {
    <E, A2, E2, R2>(f: (cause: Cause.Cause<E>) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E2, R | R2>;
    <A, E, R, A2, E2, R2>(self: Fx<A, E, R>, f: (cause: Cause.Cause<E>) => Fx<A2, E2, R2>): Fx<A | A2, E2, R | R2>;
};
```

## Why

A full `Cause` retains typed failures, defects, interruption, and composed
causes. Handling that structure explicitly is necessary at boundaries that
must translate every termination mode rather than only expected errors.

## Ownership and lifetime

The handler runs once after the source reports a cause and its returned Fx
continues in the same subscription. It receives the cause unchanged. Values
emitted before failure are not replayed, and the fallback's errors and
services replace the recovered source error and join its requirements.
Because interruption is catchable here, use this only when intentionally
translating interruption rather than for ordinary typed recovery.

## Examples

```ts
import { Cause } from "effect"
import { catchCause } from "@typed/fx/Fx"
import { failCause, succeed } from "@typed/fx/Fx"

const reported = catchCause(failCause(Cause.die("boom")), (cause) =>
  succeed(Cause.pretty(cause))
)
```
