@sentry/nextjs
Version:
Official Sentry SDK for Next.js
38 lines (34 loc) • 1.3 kB
JavaScript
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const debugBuild = require('../debug-build.js');
async function flushSafelyWithTimeout() {
try {
debugBuild.DEBUG_BUILD && core.debug.log("Flushing events...");
await core.flush(2e3);
debugBuild.DEBUG_BUILD && core.debug.log("Done flushing events");
} catch (e) {
debugBuild.DEBUG_BUILD && core.debug.log("Error while flushing events:\n", e);
}
}
function waitUntil(task) {
if (isCloudflareWaitUntilAvailable()) {
cloudflareWaitUntil(task);
return;
}
core.vercelWaitUntil(task);
}
function _getOpenNextCloudflareContext() {
const openNextCloudflareContextSymbol = /* @__PURE__ */ Symbol.for("__cloudflare-context__");
return core.GLOBAL_OBJ[openNextCloudflareContextSymbol]?.ctx;
}
function cloudflareWaitUntil(task) {
_getOpenNextCloudflareContext()?.waitUntil(task);
}
function isCloudflareWaitUntilAvailable() {
return typeof _getOpenNextCloudflareContext()?.waitUntil === "function";
}
exports.cloudflareWaitUntil = cloudflareWaitUntil;
exports.flushSafelyWithTimeout = flushSafelyWithTimeout;
exports.isCloudflareWaitUntilAvailable = isCloudflareWaitUntilAvailable;
exports.waitUntil = waitUntil;
//# sourceMappingURL=responseEnd.js.map