Rocky_Mountain_Vending/.pnpm-store/v10/files/22/6d81b28f39750ac6de7c1e3b1a42ed332c6e91c83ad38f20cbe975875663f834bb595dc0c34bc4916c04559cbb1e133a10ff10285f621997db55f74df887f6
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

81 lines
2.1 KiB
Text

import { getClient, withScope } from '../currentScopes.js';
import { captureMessage, captureException } from '../exports.js';
import { addConsoleInstrumentationHandler } from '../instrument/console.js';
import { defineIntegration } from '../integration.js';
import { CONSOLE_LEVELS } from '../utils/debug-logger.js';
import { addExceptionMechanism } from '../utils/misc.js';
import { severityLevelFromString } from '../utils/severity.js';
import { safeJoin } from '../utils/string.js';
import { GLOBAL_OBJ } from '../utils/worldwide.js';
const INTEGRATION_NAME = 'CaptureConsole';
const _captureConsoleIntegration = ((options = {}) => {
const levels = options.levels || CONSOLE_LEVELS;
const handled = options.handled ?? true;
return {
name: INTEGRATION_NAME,
setup(client) {
if (!('console' in GLOBAL_OBJ)) {
return;
}
addConsoleInstrumentationHandler(({ args, level }) => {
if (getClient() !== client || !levels.includes(level)) {
return;
}
consoleHandler(args, level, handled);
});
},
};
}) ;
/**
* Send Console API calls as Sentry Events.
*/
const captureConsoleIntegration = defineIntegration(_captureConsoleIntegration);
function consoleHandler(args, level, handled) {
const captureContext = {
level: severityLevelFromString(level),
extra: {
arguments: args,
},
};
withScope(scope => {
scope.addEventProcessor(event => {
event.logger = 'console';
addExceptionMechanism(event, {
handled,
type: 'console',
});
return event;
});
if (level === 'assert') {
if (!args[0]) {
const message = `Assertion failed: ${safeJoin(args.slice(1), ' ') || 'console.assert'}`;
scope.setExtra('arguments', args.slice(1));
captureMessage(message, captureContext);
}
return;
}
const error = args.find(arg => arg instanceof Error);
if (error) {
captureException(error, captureContext);
return;
}
const message = safeJoin(args, ' ');
captureMessage(message, captureContext);
});
}
export { captureConsoleIntegration };
//# sourceMappingURL=captureconsole.js.map