frontend/.pnpm-store/v3/files/db/ab31a06fb382d7578de109f1f613f0688c974b7b75d4c7c81c3b48c77a0900f9e5bc8296abc65f6763336236055c1f1290571b4efa79e76081ee1d86d106df

33 lines
960 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.captureError = exports.errorContext = void 0;
var config_1 = require("../config");
var context = null;
function errorContext(cb) {
if (config_1.config.useDeprecatedSynchronousErrorHandling) {
var isRoot = !context;
if (isRoot) {
context = { errorThrown: false, error: null };
}
cb();
if (isRoot) {
var _a = context, errorThrown = _a.errorThrown, error = _a.error;
context = null;
if (errorThrown) {
throw error;
}
}
}
else {
cb();
}
}
exports.errorContext = errorContext;
function captureError(err) {
if (config_1.config.useDeprecatedSynchronousErrorHandling && context) {
context.errorThrown = true;
context.error = err;
}
}
exports.captureError = captureError;
//# sourceMappingURL=errorContext.js.map