import * as tsplus_module_1 from "@effect/core/io/Effect/operations/fail";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/succeedNow";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/timeoutTo";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/flatten";
/**
 * The same as `timeout`, but instead of producing a `None` in the event of
 * timeout, it will produce the specified error.
 *
 * @tsplus fluent ets/Effect timeoutFail
 */

export function timeoutFail_(self, e, duration, __tsplusTrace) {
  return tsplus_module_4.flattenNow(tsplus_module_3.timeoutTo_(self, () => tsplus_module_1.fail(e, __tsplusTrace), tsplus_module_2.succeedNow, duration, __tsplusTrace), __tsplusTrace);
}
/**
 * The same as `timeout`, but instead of producing a `None` in the event of
 * timeout, it will produce the specified error.
 *
 * @tsplus static ets/Effect/Aspects timeoutFail
 */

export const timeoutFail = (e, duration, __tsplusTrace) => self => timeoutFail_(self, e, duration, __tsplusTrace);
//# sourceMappingURL=timeoutFail.mjs.map