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

Function failures

packages/effect/src/internal/cause.ts:200–210  ·  view source on GitHub ↗
(self: Cause.Cause<E>)

Source from the content-addressed store, hash-verified

198
199/** @internal */
200export const failures = <E>(self: Cause.Cause<E>): Chunk.Chunk<E> =>
201 Chunk.reverse(
202 reduce<Chunk.Chunk<E>, E>(
203 self,
204 Chunk.empty<E>(),
205 (list, cause) =>
206 cause._tag === OpCodes.OP_FAIL ?
207 Option.some(pipe(list, Chunk.prepend(cause.error))) :
208 Option.none()
209 )
210 )
211
212/** @internal */
213export const defects = <E>(self: Cause.Cause<E>): Chunk.Chunk<unknown> =>

Callers

nothing calls this directly

Calls 2

reduceFunction · 0.70
pipeFunction · 0.70

Tested by

no test coverage detected