File tree 2 files changed +23
-0
lines changed
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " wrangler " : patch
3
+ ---
4
+
5
+ fix: We want to prevent any user created code from sending Events to Sentry,
6
+ which can be captured by ` uncaughtExceptionMonitor ` listener.
7
+ Miniflare code can run user code on the same process as Wrangler,
8
+ so we want to return ` null ` if ` @miniflare ` is present in the Event frames.
Original file line number Diff line number Diff line change @@ -30,6 +30,21 @@ export function initReporting() {
30
30
// from their worker during development
31
31
return null ;
32
32
} ,
33
+ /**
34
+ * We want to prevent any user created code from sending Events to Sentry,
35
+ * which can be captured by "uncaughtExceptionMonitor" listener.
36
+ * Miniflare code runs on the same process as Wrangler, so we want to return `null`
37
+ * if "@miniflare" is present in the Event frames.
38
+ */
39
+ beforeSend : ( event ) => {
40
+ return ! event . exception ?. values ?. some ( ( value ) =>
41
+ value . stacktrace ?. frames ?. some ( ( frame ) =>
42
+ frame . module ?. includes ( "@miniflare" )
43
+ )
44
+ )
45
+ ? event
46
+ : null ;
47
+ } ,
33
48
dsn :
"https://[email protected] /6190959" ,
34
49
tracesSampleRate : 1.0 ,
35
50
integrations : [
You can’t perform that action at this time.
0 commit comments