/** * Returns a stream that effectfully "peeks" at the failure of the stream. * * @tsplus static effect/core/stream/Stream.Aspects tapError * @tsplus pipeable effect/core/stream/Stream tapError */ export function tapError( f: (e: E) => Effect ) { return (self: Stream): Stream => self.catchAll((e) => Stream.fromEffect(f(e)) > Stream.fail(e)) }