UNPKG

@harmoniclabs/plu-ts-onchain

Version:

An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript

21 lines (20 loc) 831 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.perror = void 0; var IRError_1 = require("../../IR/IRNodes/IRError.js"); var Term_1 = require("../Term/index.js"); function perror(type, msg, addInfos) { var _a; if (msg === void 0) { msg = undefined; } if (addInfos === void 0) { addInfos = {}; } addInfos = typeof addInfos === "object" && addInfos !== null ? addInfos : { __original__: addInfos }; var src = (_a = new Error().stack) === null || _a === void 0 ? void 0 : _a.split("\n")[2]; src = src === null || src === void 0 ? void 0 : src.slice(src.indexOf("at ") + 3); addInfos.__src__ = src; return new Term_1.Term(type, function (_dbn) { return new IRError_1.IRError(msg, addInfos); }); } exports.perror = perror;