Feedback on Generic Error Handling Solution in TypeScript

Just looking into generic error handling a little bit, I know there have been a couple of other threads about it but people were not too thrilled with the solutions. Ended up with this solution for us, just curious if anyone seens any issues with this?
  static captureTags<E>(
    tags: [ExtractTagTypes<NoInfer<E>>, ...Array<ExtractTagTypes<NoInfer<E>>>],
  ) {
    return <S, R>(effect: Effect.Effect<S, E, R>) =>
      effect.pipe(
        Effect.catchTag(...tags, (e) =>
          ErrorTrackerService.captureException(e).pipe(Effect.andThen(Effect.fail(e))),
        ),
      )
  }

Or a playground for those that prefer it: https://effect.website/play/#36cf219551b9
Was this page helpful?