Files
klz-cables.com/.pnpm-store/v10/files/3a/ceedc001731677e8a665610dff31a68870321d26fb0b1c7065ec624e172e08cee10b1a196144d689c2591c023462d800cea3380c36118313bfd4bb364e2d01
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

65 lines
1.7 KiB
Plaintext

import * as util from 'node:util';
import { defineIntegration } from '@sentry/core';
const INTEGRATION_NAME = 'NodeSystemError';
function isSystemError(error) {
if (!(error instanceof Error)) {
return false;
}
if (!('errno' in error) || typeof error.errno !== 'number') {
return false;
}
// Appears this is the recommended way to check for Node.js SystemError
// https://github.com/nodejs/node/issues/46869
return util.getSystemErrorMap().has(error.errno);
}
/**
* Captures context for Node.js SystemError errors.
*/
const systemErrorIntegration = defineIntegration((options = {}) => {
return {
name: INTEGRATION_NAME,
processEvent: (event, hint, client) => {
if (!isSystemError(hint.originalException)) {
return event;
}
const error = hint.originalException;
const errorContext = {
...error,
};
if (!client.getOptions().sendDefaultPii && options.includePaths !== true) {
delete errorContext.path;
delete errorContext.dest;
}
event.contexts = {
...event.contexts,
node_system_error: errorContext,
};
for (const exception of event.exception?.values || []) {
if (exception.value) {
if (error.path && exception.value.includes(error.path)) {
exception.value = exception.value.replace(`'${error.path}'`, '').trim();
}
if (error.dest && exception.value.includes(error.dest)) {
exception.value = exception.value.replace(`'${error.dest}'`, '').trim();
}
}
}
return event;
},
};
});
export { systemErrorIntegration };
//# sourceMappingURL=systemError.js.map