Using Pipeline in `catchAll` Handler

How do I use a pipeline in a catchAll handler? For example, the wrong thing I have is:

someEffect().pipe(
  Effect.catchAll(err =>
    Effect.gen(function*() {
      doSomethingNonEffectful(err)
      yield* somethingEffectful()
      return Effect.fail(err)
    })
  )
)


But this results in an effect whose result is the union of the result of someEffect() and Effect.Effect<never, UnknownException, never>, whereas I just want it to be the result of someEffect (in other words, my catch all should legitimately fail, I just process the error first in the callback).
Was this page helpful?