MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / redactEvent

Function redactEvent

src/utils/sentry.ts:70–104  ·  view source on GitHub ↗
(event: Sentry.ErrorEvent)

Source from the content-addressed store, hash-verified

68}
69
70function redactEvent(event: Sentry.ErrorEvent): Sentry.ErrorEvent {
71 // Remove default identity/request surfaces entirely.
72 delete event.user;
73 delete event.request;
74 delete event.breadcrumbs;
75
76 if (typeof event.message === 'string') {
77 event.message = redactPathLikeData(event.message);
78 }
79
80 const exceptionValues = event.exception?.values ?? [];
81 for (const exceptionValue of exceptionValues) {
82 if (typeof exceptionValue.value === 'string') {
83 exceptionValue.value = redactPathLikeData(exceptionValue.value);
84 }
85
86 const frames = exceptionValue.stacktrace?.frames ?? [];
87 for (const frame of frames) {
88 if (typeof frame.abs_path === 'string') {
89 frame.abs_path = redactPathLikeData(frame.abs_path);
90 }
91 if (typeof frame.filename === 'string') {
92 frame.filename = redactPathLikeData(frame.filename);
93 }
94 }
95 }
96
97 if (event.extra) {
98 for (const [key, value] of Object.entries(event.extra)) {
99 event.extra[key] = redactUnknown(value);
100 }
101 }
102
103 return event;
104}
105
106function redactLog(log: Sentry.Log): Sentry.Log | null {
107 if (!log) {

Callers 1

__redactEventForTestsFunction · 0.85

Calls 2

redactPathLikeDataFunction · 0.85
redactUnknownFunction · 0.85

Tested by

no test coverage detected