const fileName_1 = "(@effect/core) _src/io/Layer/operations/tapError.ts";
import * as tsplus_module_1 from "@effect/core/io/Effect/operations/failNow";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/flatMap";
import * as tsplus_module_3 from "@effect/core/io/Layer/operations/fromEffectEnvironment";
import * as tsplus_module_4 from "@effect/core/io/Layer/operations/catchAll";
/**
 * Performs the specified effect if this layer fails.
 *
 * @tsplus fluent ets/Layer tapError
 */

export function tapError_(self, f) {
  return tsplus_module_4.catchAll_(self, e => tsplus_module_3.fromEffectEnvironment(() => tsplus_module_2.flatMap_(f(e), () => tsplus_module_1.failNow(e, fileName_1 + ":10:92"), fileName_1 + ":10:71"), fileName_1 + ":10:58"));
}
/**
 * Performs the specified effect if this layer fails.
 *
 * @tsplus static ets/Layer/Aspects tapError
 */

export const tapError = f => self => tapError_(self, f);
//# sourceMappingURL=tapError.mjs.map