(event: ErrorEvent)
| 32 | } |
| 33 | |
| 34 | export function disableSentry() { |
| 35 | sentryEnabled = false; |
| 36 | void Sentry.close(); |
| 37 | } |
| 38 | |
| 39 | function 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 |
no test coverage detected