// Existing workflow I can't modify
const workflow = Effect.gen(function* (_) {
const step1 = yield* _(Effect.fail(new Step1Error("Failed")))
const step2 = yield* _(Effect.succeed(`Processing ${step1}`))
const step3 = yield* _(Effect.succeed("Done"))
return { step1, step2, step3 }
})
// What I want to do (pseudo-code for illustration):
const handled = workflow.pipe(
Effect.catchTagWith('Step1Error', () =>
// How to provide replacement value and continue the workflow?
// Rather than replacing the entire effect
)
)
// Existing workflow I can't modify
const workflow = Effect.gen(function* (_) {
const step1 = yield* _(Effect.fail(new Step1Error("Failed")))
const step2 = yield* _(Effect.succeed(`Processing ${step1}`))
const step3 = yield* _(Effect.succeed("Done"))
return { step1, step2, step3 }
})
// What I want to do (pseudo-code for illustration):
const handled = workflow.pipe(
Effect.catchTagWith('Step1Error', () =>
// How to provide replacement value and continue the workflow?
// Rather than replacing the entire effect
)
)