const fileName_1 = "(@effect/core) _src/stream/Stream/operations/catchTag.ts";
import * as tsplus_module_1 from "@effect/core/stream/Stream/operations/fail";
import * as tsplus_module_2 from "@effect/core/stream/Stream/operations/catchAll";
/**
 * Recovers from specified error.
 *
 * @tsplus fluent ets/Stream catchTag
 */

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

    return tsplus_module_1.fail(() => e, fileName_1 + ":23:23");
  }, fileName_1 + ":19:23");
}
/**
 * Recovers from specified error.
 *
 * @tsplus static ets/Stream/Aspects catchTag
 */

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