// ets_tracing: off import { fail as effectFail } from "../Effect/fail.js" import { completeWith } from "./completeWith.js" import type { Promise } from "./promise.js" /** * Fails the promise with the specified error, which will be propagated to all * fibers waiting on the value of the promise. */ export function fail_(promise: Promise, e: E) { return completeWith(effectFail(e))(promise) } /** * Fails the promise with the specified error, which will be propagated to all * fibers waiting on the value of the promise. */ export function fail(e: E) { return (promise: Promise) => fail_(promise, e) }