/** * Returns a stream that effectfully "peeks" at the cause of failure of the * stream. * * @tsplus static effect/core/stream/Stream.Aspects tapErrorCause * @tsplus pipeable effect/core/stream/Stream tapErrorCause */ export function tapErrorCause( f: (cause: Cause) => Effect ) { return (self: Stream): Stream => self.catchAllCause((e) => Stream.fromEffect(f(e).zipRight(Effect.failCause(e)))) }