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

Function failuresToDefects

packages/effect/src/sql/SqlClient.ts:577–582  ·  view source on GitHub ↗
(cause: Cause.Cause<E>)

Source from the content-addressed store, hash-verified

575 * must not be able to hide them.
576 */
577const failuresToDefects = <E>(cause: Cause.Cause<E>): Cause.Cause<never> =>
578 Cause.fromReasons(cause.reasons.map((reason) =>
579 Cause.isFailReason(reason)
580 ? Cause.makeDieReason(reason.error).annotate(Cause.reasonAnnotations(reason))
581 : reason
582 ))
583
584/**
585 * Callbacks registered with `afterCommit` in one transaction level. A

Callers 1

makeWithTransactionFunction · 0.85

Calls 2

annotateMethod · 0.65
mapMethod · 0.45

Tested by

no test coverage detected