"use strict"
Object.defineProperty(exports, "__esModule", { value: true })
exports.refailWithTrace = void 0
// tracing: off
const Cause_1 = require("../Cause")
const core_1 = require("./core")
/**
 * Attach a wrapping trace pointing to this location in case of error.
 *
 * Useful when joining fibers to make the resulting trace mention
 * the `join` point, otherwise only the traces of joined fibers are
 * included.
 */
function refailWithTrace(self, __trace) {
  return (0, core_1.foldCauseM_)(
    self,
    (cause) => (0, core_1.haltWith)((trace) => (0, Cause_1.traced)(cause, trace())),
    core_1.succeed,
    __trace
  )
}
exports.refailWithTrace = refailWithTrace
//# sourceMappingURL=refailWithTrace.js.map
