import * as tsplus_module_1 from "@effect/core/stream/Channel/operations/succeedNow";
import { ContinuationK, Fold } from "@effect/core/stream/Channel/definition/primitives";
/**
 * Returns a new channel that is the same as this one, except if this channel
 * errors for any cause at all, then the returned channel will switch over to
 * using the fallback channel returned by the specified error handler.
 *
 * @tsplus fluent ets/Channel catchAllCause
 */

export function catchAllCause_(self, f) {
  return new Fold(self, new ContinuationK(tsplus_module_1.succeedNow, f));
}
/**
 * Returns a new channel that is the same as this one, except if this channel
 * errors for any cause at all, then the returned channel will switch over to
 * using the fallback channel returned by the specified error handler.
 *
 * @tsplus static ets/Channel/Aspects catchAllCause
 */

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