Rocky_Mountain_Vending/.pnpm-store/v10/files/3d/f19f2a8285142ae0ec0c616792eb8a6f3f5554d6d03e14d782e8107aeeb61361bd7a7d1a3be87b0a5529f50c385b36652edf9ac369b35eecfee6b800343d64
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

53 lines
1.4 KiB
Text

import { getClient } from '../../currentScopes.js';
import { captureException } from '../../exports.js';
import { getActiveSpan } from '../../utils/spanUtils.js';
import { SPAN_STATUS_ERROR } from '../../tracing/spanstatus.js';
/**
* Safe error capture utilities for MCP server instrumentation
*
* Ensures error reporting never interferes with MCP server operation.
* All capture operations are wrapped in try-catch to prevent side effects.
*/
/**
* Captures an error without affecting MCP server operation.
*
* The active span already contains all MCP context (method, tool, arguments, etc.)
* @param error - Error to capture
* @param errorType - Classification of error type for filtering
* @param extraData - Additional context data to include
*/
function captureError(error, errorType, extraData) {
try {
const client = getClient();
if (!client) {
return;
}
const activeSpan = getActiveSpan();
if (activeSpan?.isRecording()) {
activeSpan.setStatus({
code: SPAN_STATUS_ERROR,
message: 'internal_error',
});
}
captureException(error, {
mechanism: {
type: 'mcp_server',
handled: false,
data: {
error_type: errorType || 'handler_execution',
...extraData,
},
},
});
} catch {
// noop
}
}
export { captureError };
//# sourceMappingURL=errorCapture.js.map