import * as tsplus_module_1 from "@effect/core/io/Effect/operations/failNow";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/catchAll";
/**
 * Recovers from specified error.
 *
 * @tsplus fluent ets/Effect catchTag
 */

export function catchTag_(self, k, f, __tsplusTrace) {
  return tsplus_module_2.catchAll_(self, e => {
    if ("_tag" in e && e["_tag"] === k) {
      return f(e);
    }

    return tsplus_module_1.failNow(e, __tsplusTrace);
  }, __tsplusTrace);
}
/**
 * Recovers from specified error.
 *
 * @tsplus static ets/Effect/Aspects catchTag
 */

export const catchTag = (k, f, __tsplusTrace) => self => catchTag_(self, k, f, __tsplusTrace);
//# sourceMappingURL=catchTag.mjs.map