import * as tracing_1 from "../../Tracing";
const fileName_1 = "(@effect-ts/system): _src/Stream/Stream/catchTag.ts";
import * as CatchAll from "./catchAll";
import * as Fail from "./fail";
/**
 * Recovers from specified error.
 *
 * @ets_data_first catchTag_
 */

export function catchTag(k, f) {
  return self => catchTag_(self, k, f);
}
/**
 * Recovers from specified error.
 */

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

    return Fail.fail(e);
  });
}
//# sourceMappingURL=catchTag.js.map