const fileName_1 = "(@effect/core) _src/io/Metrics/operations/trackErrorWith.ts";
import * as tsplus_module_1 from "@effect/core/io/Metrics/operations/update";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/tapError";
/**
 * Returns an aspect that will update this metric with the result of applying
 * the specified function to the error value of the effects that the aspect is
 * applied to.
 *
 * @tsplus fluent ets/Metrics/Metric trackErrorWith
 */

export function trackErrorWith_(self, f) {
  const updater = error => tsplus_module_1.update_(self, () => f(error), fileName_1 + ":9:74");

  return (effect, __tsplusTrace) => tsplus_module_2.tapError_(effect, updater, fileName_1 + ":11:20");
}
/**
 * Returns an aspect that will update this metric with the result of applying
 * the specified function to the error value of the effects that the aspect is
 * applied to.
 *
 * @tsplus static ets/Metrics/Metric/Aspects trackErrorWith
 */

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