{
  "id": "@typed/fx/Fx#catchCause",
  "canonicalId": "@typed/fx/Fx#catchCause",
  "symbol": {
    "id": "@typed/fx/Fx#catchCause",
    "packageName": "@typed/fx",
    "moduleName": "Fx",
    "exportName": "catchCause",
    "kind": "constant",
    "signatures": [
      "export declare const catchCause: {\n    <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>;\n    <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>;\n};"
    ],
    "summary": "Recovers from any failure cause by running a fallback Fx.",
    "sections": {
      "Why": "A full `Cause` retains typed failures, defects, interruption, and composed\ncauses. Handling that structure explicitly is necessary at boundaries that\nmust 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\ncontinues in the same subscription. It receives the cause unchanged. Values\nemitted before failure are not replayed, and the fallback's errors and\nservices replace the recovered source error and join its requirements.\nBecause interruption is catchable here, use this only when intentionally\ntranslating interruption rather than for ordinary typed recovery."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Cause } from \"effect\"\nimport { catchCause } from \"@typed/fx/Fx\"\nimport { failCause, succeed } from \"@typed/fx/Fx\"\n\nconst reported = catchCause(failCause(Cause.die(\"boom\")), (cause) =>\n  succeed(Cause.pretty(cause))\n)"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/catch.ts",
      "line": 148
    },
    "since": "1.0.0",
    "category": "Errors and recovery"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Fx#catchCause",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": "Fx",
    "consumerSpecifier": "@typed/fx/Fx",
    "exportName": "catchCause",
    "qualifiedName": "catchCause",
    "declarationKey": "declaration:9e90b6cbfb9d97e26b593743",
    "family": "variable",
    "signatures": [
      "export declare const catchCause: {\n    <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>;\n    <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>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 148,
          "column": 14
        },
        "end": {
          "line": 166,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 149,
          "column": 3
        },
        "end": {
          "line": 151,
          "column": 58
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 153,
          "column": 3
        },
        "end": {
          "line": 156,
          "column": 29
        }
      }
    ],
    "aliases": [
      "@typed/fx#Fx.catchCause"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:9e90b6cbfb9d97e26b593743",
    "name": "catchCause",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const catchCause: {\n    <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>;\n    <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>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/catch.ts",
            "start": {
              "line": 148,
              "column": 14
            },
            "end": {
              "line": 166,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<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>;"
        ],
        "typeParameters": [
          "E",
          "A2",
          "E2",
          "R2",
          "A",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/catch.ts",
            "start": {
              "line": 149,
              "column": 3
            },
            "end": {
              "line": 151,
              "column": 58
            }
          },
          {
            "file": "packages/fx/src/Fx/combinators/catch.ts",
            "start": {
              "line": 153,
              "column": 3
            },
            "end": {
              "line": 156,
              "column": 29
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const catchCause: {\n    <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>;\n    <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>;\n};"
    ],
    "typeParameters": [
      "E",
      "A2",
      "E2",
      "R2",
      "A",
      "R"
    ],
    "summary": "Recovers from any failure cause by running a fallback Fx.",
    "sections": {
      "Why": "A full `Cause` retains typed failures, defects, interruption, and composed\ncauses. Handling that structure explicitly is necessary at boundaries that\nmust 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\ncontinues in the same subscription. It receives the cause unchanged. Values\nemitted before failure are not replayed, and the fallback's errors and\nservices replace the recovered source error and join its requirements.\nBecause interruption is catchable here, use this only when intentionally\ntranslating interruption rather than for ordinary typed recovery."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Cause } from \"effect\"\nimport { catchCause } from \"@typed/fx/Fx\"\nimport { failCause, succeed } from \"@typed/fx/Fx\"\n\nconst reported = catchCause(failCause(Cause.die(\"boom\")), (cause) =>\n  succeed(Cause.pretty(cause))\n)"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 148,
          "column": 14
        },
        "end": {
          "line": 166,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 149,
          "column": 3
        },
        "end": {
          "line": 151,
          "column": 58
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/catch.ts",
        "start": {
          "line": 153,
          "column": 3
        },
        "end": {
          "line": 156,
          "column": 29
        }
      }
    ],
    "since": "1.0.0",
    "category": "Errors and recovery"
  }
}
