MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / beforeSend

Function beforeSend

static/sentry.ts:101–128  ·  view source on GitHub ↗
(event, hint)

Source from the content-addressed store, hash-verified

99 'Canceled',
100 ],
101 beforeSend(event, hint) {
102 // Filter Monaco Editor errors
103 //
104 // IMPORTANT: Frame-based filtering doesn't work reliably!
105 // In beforeSend hooks, frame.filename contains minified bundle paths like:
106 // "https://static.ce-cdn.net/vendor.v59.be68c0bf31258854d1b2.js"
107 //
108 // Source mapping happens AFTER beforeSend processing, which is why the
109 // final Sentry UI shows readable paths like:
110 // "./node_modules/monaco-editor/esm/vs/platform/clipboard/browser/clipboardService.js"
111 //
112 // For reliable filtering, use:
113 // 1. ignoreErrors patterns (processed before beforeSend)
114 // 2. Error message content (event.exception.values[0].value)
115 // 3. Error type (event.exception.values[0].type)
116 //
117 // DO NOT rely on frame.filename, frame.module, or frame.function for Monaco errors!
118
119 if (event.exception?.values?.[0]) {
120 // Filter hit testing errors
121 // See: https://github.com/microsoft/monaco-editor/issues/4527
122 // Uses error message content since frame data is minified
123 if (event.exception.values[0].value?.includes('_doHitTestWithCaretPositionFromPoint')) {
124 return null; // Don't send to Sentry
125 }
126 }
127 return event;
128 },
129 });
130 window.addEventListener('unhandledrejection', event => {
131 let reason = event.reason;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected