MCPcopy Create free account
hub / github.com/Effect-TS/effect / causeReasonToFormatter

Function causeReasonToFormatter

packages/effect/src/Schema.ts:10423–10434  ·  view source on GitHub ↗
(error: Formatter<E>, defect: Formatter<unknown>)

Source from the content-addressed store, hash-verified

10421}
10422
10423function causeReasonToFormatter<E>(error: Formatter<E>, defect: Formatter<unknown>) {
10424 return (t: Cause_.Reason<E>) => {
10425 switch (t._tag) {
10426 case "Fail":
10427 return `Fail(${error(t.error)})`
10428 case "Die":
10429 return `Die(${defect(t.defect)})`
10430 case "Interrupt":
10431 return "Interrupt"
10432 }
10433 }
10434}
10435
10436/**
10437 * Type-level representation returned by {@link Cause}.

Callers 2

CauseReasonFunction · 0.85
causeToFormatterFunction · 0.85

Calls 1

errorFunction · 0.70

Tested by

no test coverage detected