Rocky_Mountain_Vending/.pnpm-store/v10/files/38/4183c0ab1fb74648ecf47ec5b44062bead21e0866476d526a3753a43d2e969f46398f642fc9782b90fc2d11902c3dc3eabeff1b3fa4c89a70af1db750d036a
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

98 lines
2.6 KiB
Text

import * as diagnosticsChannel from 'node:diagnostics_channel';
import { defineIntegration, addBreadcrumb, captureException } from '@sentry/core';
const INTEGRATION_NAME = 'ChildProcess';
/**
* Capture breadcrumbs and events for child processes and worker threads.
*/
const childProcessIntegration = defineIntegration((options = {}) => {
return {
name: INTEGRATION_NAME,
setup() {
diagnosticsChannel.channel('child_process').subscribe((event) => {
if (event && typeof event === 'object' && 'process' in event) {
captureChildProcessEvents(event.process , options);
}
});
diagnosticsChannel.channel('worker_threads').subscribe((event) => {
if (event && typeof event === 'object' && 'worker' in event) {
captureWorkerThreadEvents(event.worker , options);
}
});
},
};
});
function captureChildProcessEvents(child, options) {
let hasExited = false;
let data;
child
.on('spawn', () => {
// This is Sentry getting macOS OS context
if (child.spawnfile === '/usr/bin/sw_vers') {
hasExited = true;
return;
}
data = { spawnfile: child.spawnfile };
if (options.includeChildProcessArgs) {
data.spawnargs = child.spawnargs;
}
})
.on('exit', code => {
if (!hasExited) {
hasExited = true;
// Only log for non-zero exit codes
if (code !== null && code !== 0) {
addBreadcrumb({
category: 'child_process',
message: `Child process exited with code '${code}'`,
level: code === 0 ? 'info' : 'warning',
data,
});
}
}
})
.on('error', error => {
if (!hasExited) {
hasExited = true;
addBreadcrumb({
category: 'child_process',
message: `Child process errored with '${error.message}'`,
level: 'error',
data,
});
}
});
}
function captureWorkerThreadEvents(worker, options) {
let threadId;
worker
.on('online', () => {
threadId = worker.threadId;
})
.on('error', error => {
if (options.captureWorkerErrors !== false) {
captureException(error, {
mechanism: { type: 'instrument', handled: false, data: { threadId: String(threadId) } },
});
} else {
addBreadcrumb({
category: 'worker_thread',
message: `Worker thread errored with '${error.message}'`,
level: 'error',
data: { threadId },
});
}
});
}
export { childProcessIntegration };
//# sourceMappingURL=childProcess.js.map