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

Function failWithCatch

packages/effect/src/internal/effect.ts:1072–1078  ·  view source on GitHub ↗
(cause: unknown)

Source from the content-addressed store, hash-verified

1070 : options.catch
1071 return callbackOptions<A, E>(function(resume, signal) {
1072 const failWithCatch = (cause: unknown) => {
1073 try {
1074 resume(fail(internalCall(() => catcher(cause)) as E))
1075 } catch (err) {
1076 resume(die(err))
1077 }
1078 }
1079 try {
1080 internalCall(() => f(signal!)).then(
1081 (a) => resume(succeed(a)),

Callers 1

tryPromiseFunction · 0.85

Calls 3

failFunction · 0.70
dieFunction · 0.70
resumeFunction · 0.50

Tested by

no test coverage detected