rescript
Version:
30 lines (23 loc) • 656 B
JavaScript
;
var Caml_option = require("./caml_option.js");
var Caml_exceptions = require("./caml_exceptions.js");
var $$Error = /* @__PURE__ */Caml_exceptions.create("Caml_js_exceptions.Error");
function internalToOCamlException(e) {
if (Caml_exceptions.caml_is_extension(e)) {
return e;
} else {
return {
RE_EXN_ID: $$Error,
_1: e
};
}
}
function caml_as_js_exn(exn) {
if (exn.RE_EXN_ID === $$Error) {
return Caml_option.some(exn._1);
}
}
exports.$$Error = $$Error;
exports.internalToOCamlException = internalToOCamlException;
exports.caml_as_js_exn = caml_as_js_exn;
/* No side effect */