-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathinit.js
41 lines (36 loc) · 996 Bytes
/
init.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import * as Sentry from '@sentry/browser';
import { moduleMetadataIntegration } from '@sentry/browser';
import { rewriteFramesIntegration } from '@sentry/browser';
Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [
moduleMetadataIntegration(),
rewriteFramesIntegration({
iteratee: frame => {
return {
...frame,
filename: 'bloop', // something that should completely mess with module metadata association
};
},
}),
],
beforeSend(event) {
const moduleMetadataEntries = [];
if (event.type === undefined) {
try {
event.exception.values.forEach(value => {
value.stacktrace.frames.forEach(frame => {
moduleMetadataEntries.push(frame.module_metadata);
});
});
} catch (e) {
// noop
}
}
event.extra = {
...event.extra,
module_metadata_entries: moduleMetadataEntries,
};
return event;
},
});