/** * Returns an effect that effectfully "peeks" at the failure of this effect. * * @tsplus static effect/core/io/Effect.Aspects tapError * @tsplus pipeable effect/core/io/Effect tapError */ export function tapError( f: (e: E) => Effect ) { return (self: Effect): Effect => self.foldCauseEffect( (cause) => cause.failureOrCause.fold( (e) => f(e).zipRight(Effect.failCause(cause)), () => Effect.failCause(cause) ), Effect.succeed ) }