MCPcopy Create free account
hub / github.com/ProtonDriveApps/sdk / scrubErrorEventForLocalPii

Function scrubErrorEventForLocalPii

cli/src/telemetry/sentry.ts:34–70  ·  view source on GitHub ↗
(event: ErrorEvent)

Source from the content-addressed store, hash-verified

32}
33
34export function disableSentry() {
35 sentryEnabled = false;
36 void Sentry.close();
37}
38
39function scrubErrorEventForLocalPii(event: ErrorEvent): ErrorEvent {
40 if (event.message) {
41 event.message = scrubPathsInString(event.message);
42 }
43 if (event.logentry?.message) {
44 event.logentry.message = scrubPathsInString(event.logentry.message);
45 }
46
47 const exceptions = event.exception?.values;
48 if (exceptions) {
49 for (const ex of exceptions) {
50 if (ex.value) {
51 ex.value = scrubPathsInString(ex.value);
52 }
53 const frames = ex.stacktrace?.frames;
54 if (frames) {
55 for (const frame of frames) {
56 scrubStackFrame(frame);
57 }
58 }
59 }
60 }
61
62 const threads = event.threads?.values;
63 if (threads) {
64 for (const thread of threads) {
65 const frames = thread.stacktrace?.frames;
66 if (frames) {
67 for (const frame of frames) {
68 scrubStackFrame(frame);
69 }
70 }
71 }
72 }
73

Callers 1

beforeSendFunction · 0.85

Calls 2

scrubPathsInStringFunction · 0.85
scrubStackFrameFunction · 0.85

Tested by

no test coverage detected