Files
klz-cables.com/.pnpm-store/v10/files/47/be3dcd14f43894c297e2c8a1be7e9cacc6ddfc8c2bb46fcfd6717d99c78572fef90c3caff7523d4206c83e5921a60f1f0ffb03e73ba88d3a63946d41f00ced
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

56 lines
1.5 KiB
Plaintext

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const currentScopes = require('../../currentScopes.js');
const _exports = require('../../exports.js');
const spanUtils = require('../../utils/spanUtils.js');
const spanstatus = require('../../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 = currentScopes.getClient();
if (!client) {
return;
}
const activeSpan = spanUtils.getActiveSpan();
if (activeSpan?.isRecording()) {
activeSpan.setStatus({
code: spanstatus.SPAN_STATUS_ERROR,
message: 'internal_error',
});
}
_exports.captureException(error, {
mechanism: {
type: 'auto.ai.mcp_server',
handled: false,
data: {
error_type: errorType || 'handler_execution',
...extraData,
},
},
});
} catch {
// noop
}
}
exports.captureError = captureError;
//# sourceMappingURL=errorCapture.js.map