Rich defect tracking, Cause algebra, sandboxing, and causal AST execution trace rendering for fx.
Rich defect tracking, Cause algebra, sandboxing, and causal AST execution trace rendering for fx.
(cause-die defect)Creates a Cause representing an unexpected defect / Throwable exception.
Creates a Cause representing an unexpected defect / Throwable exception.
(cause-fail failure)Creates a Cause representing a checked domain Failure.
Creates a Cause representing a checked domain Failure.
(cause-interrupt reason)Creates a Cause representing computation cancellation or interruption.
Creates a Cause representing computation cancellation or interruption.
(cause-parallel causes)Creates a composite Cause representing accumulated parallel failures.
Creates a composite Cause representing accumulated parallel failures.
(cause-sequential c1 c2)Creates a composite Cause representing sequential failures.
Creates a composite Cause representing sequential failures.
(cause? x)Returns true if x implements ICause.
Returns true if `x` implements ICause.
(defects cause)Collects all defect Throwables contained within cause tree into a vector.
Collects all defect Throwables contained within `cause` tree into a vector.
(die-cause? x)Returns true if x is a Die cause.
Returns true if `x` is a Die cause.
(fail-cause? x)Returns true if x is a Fail cause.
Returns true if `x` is a Fail cause.
(failures cause)Collects all IFailure values contained within cause tree into a vector.
Collects all IFailure values contained within `cause` tree into a vector.
Protocol for structured Cause error tree algebra nodes.
Protocol for structured Cause error tree algebra nodes.
(cause-type this)Returns the keyword classification of this cause node.
Returns the keyword classification of this cause node.
(interrupt-cause? x)Returns true if x is an Interrupt cause.
Returns true if `x` is an Interrupt cause.
(parallel-cause? x)Returns true if x is a Parallel cause.
Returns true if `x` is a Parallel cause.
(render-cause cause)Formats a Cause tree into a human-readable hierarchical ASCII string.
Formats a `Cause` tree into a human-readable hierarchical ASCII string.
(render-execution-trace leaf-effect)(render-execution-trace leaf-effect failure-or-cause)Inspects the AST pipeline of leaf-effect using fx.utils and formats an execution trace
showing each step from root to leaf, optionally highlighting failure-or-cause.
Inspects the AST pipeline of `leaf-effect` using `fx.utils` and formats an execution trace showing each step from root to leaf, optionally highlighting `failure-or-cause`.
(sandbox> eff)(sandbox> prev-effect eff)Catches both domain IFailure records and unexpected thrown Throwable defects,
exposing them as a typed Cause value (Fail or Die) on the success channel.
Example: (-> (risky-operation>) (fx.observability.diagnostics/sandbox>) (fx/map> (fn [cause-or-val] (if (fx.observability.diagnostics/cause? cause-or-val) (handle-cause cause-or-val) cause-or-val))))
Catches both domain `IFailure` records and unexpected thrown `Throwable` defects,
exposing them as a typed `Cause` value (`Fail` or `Die`) on the success channel.
Example:
(-> (risky-operation>)
(fx.observability.diagnostics/sandbox>)
(fx/map> (fn [cause-or-val]
(if (fx.observability.diagnostics/cause? cause-or-val)
(handle-cause cause-or-val)
cause-or-val))))(sequential-cause? x)Returns true if x is a Sequential cause.
Returns true if `x` is a Sequential cause.
(unsandbox> eff)(unsandbox> prev-effect eff)Inverts sandbox> by re-emitting Cause values as effect failures (Fail) or
throwing unexpected defects (Die). Passes non-Cause success values through.
Example: (-> (fx.observability.diagnostics/sandbox> (work>)) (fx/map> transform-cause) (fx.observability.diagnostics/unsandbox>))
Inverts `sandbox>` by re-emitting `Cause` values as effect failures (`Fail`) or
throwing unexpected defects (`Die`). Passes non-Cause success values through.
Example:
(-> (fx.observability.diagnostics/sandbox> (work>))
(fx/map> transform-cause)
(fx.observability.diagnostics/unsandbox>))cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |