MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / addMetadataToStackFrames

Function addMetadataToStackFrames

packages/core/src/metadata.ts:86–100  ·  view source on GitHub ↗
(parser: StackParser, event: Event)

Source from the content-addressed store, hash-verified

84 * Metadata is injected by the Sentry bundler plugins using the `_experiments.moduleMetadata` config option.
85 */
86export function addMetadataToStackFrames(parser: StackParser, event: Event): void {
87 event.exception?.values?.forEach(exception => {
88 exception.stacktrace?.frames?.forEach(frame => {
89 if (!frame.filename || frame.module_metadata) {
90 return;
91 }
92
93 const metadata = getMetadataForUrl(parser, frame.filename);
94
95 if (metadata) {
96 frame.module_metadata = metadata;
97 }
98 });
99 });
100}
101
102/**
103 * Strips metadata from stack frames.

Callers 4

metadata.test.tsFile · 0.90
setupFunction · 0.90
setupFunction · 0.90

Calls 2

getMetadataForUrlFunction · 0.85
forEachMethod · 0.65

Tested by

no test coverage detected