Skip to content

Commit 6801593

Browse files
committed
PR review
1 parent 8cc1e81 commit 6801593

File tree

6 files changed

+15
-3
lines changed

6 files changed

+15
-3
lines changed

packages/astro/src/index.server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ export {
124124
startSession,
125125
startSpan,
126126
startSpanManual,
127+
systemErrorIntegration,
127128
tediousIntegration,
128129
trpcMiddleware,
129130
updateSpanName,

packages/aws-serverless/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export {
114114
spanToJSON,
115115
spanToTraceHeader,
116116
spanToBaggageHeader,
117+
systemErrorIntegration,
117118
trpcMiddleware,
118119
updateSpanName,
119120
supabaseIntegration,

packages/google-cloud-serverless/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export {
115115
trpcMiddleware,
116116
updateSpanName,
117117
supabaseIntegration,
118+
systemErrorIntegration,
118119
instrumentSupabaseClient,
119120
zodErrorsIntegration,
120121
profiler,

packages/node-core/src/integrations/systemError.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { getSystemErrorMap } from 'node:util';
12
import { defineIntegration } from '@sentry/core';
2-
import { getSystemErrorMap } from 'util';
33

44
const INTEGRATION_NAME = 'NodeSystemError';
55

@@ -25,10 +25,17 @@ function isSystemError(error: unknown): error is SystemError {
2525
return getSystemErrorMap().has(error.errno);
2626
}
2727

28+
type Options = {
29+
/**
30+
* If true, includes the `path` and `dest` properties in the error context.
31+
*/
32+
includePaths?: boolean;
33+
}
34+
2835
/**
2936
* Captures context for Node.js SystemError errors.
3037
*/
31-
export const systemErrorIntegration = defineIntegration(() => {
38+
export const systemErrorIntegration = defineIntegration((options: Options = {}) => {
3239
return {
3340
name: INTEGRATION_NAME,
3441
processEvent: (event, hint, client) => {
@@ -42,7 +49,7 @@ export const systemErrorIntegration = defineIntegration(() => {
4249
...error,
4350
};
4451

45-
if (!client.getOptions().sendDefaultPii) {
52+
if (!client.getOptions().sendDefaultPii && options.includePaths !== true) {
4653
delete errorContext.path;
4754
delete errorContext.dest;
4855
}

packages/node/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ export {
165165
childProcessIntegration,
166166
createSentryWinstonTransport,
167167
SentryContextManager,
168+
systemErrorIntegration,
168169
generateInstrumentOnce,
169170
getSentryRelease,
170171
defaultStackParser,

packages/sveltekit/src/server/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ export {
113113
startSession,
114114
startSpan,
115115
startSpanManual,
116+
systemErrorIntegration,
116117
tediousIntegration,
117118
trpcMiddleware,
118119
updateSpanName,

0 commit comments

Comments
 (0)