File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,23 @@ export function initErrorTracking() {
56
56
}
57
57
}
58
58
return breadcrumb ;
59
+ } ,
60
+ beforeSend ( event , hint ) {
61
+ if ( event . exception && event . exception . values ) {
62
+ event . exception . values . forEach ( ( value ) => {
63
+ if ( ! value . value ) return ;
64
+ value . value = value . value
65
+ // Strip any usernames that end up appearing within error values.
66
+ // This helps to dedupe error reports, and it's good for privacy too
67
+ . replace ( / \/ h o m e \/ [ ^ \/ ] + \/ / g, '/home/<username>/' )
68
+ . replace ( / \/ U s e r s \/ [ ^ \/ ] + \/ / g, '/Users/<username>/' )
69
+ . replace ( / ( \w ) : \\ U s e r s \\ [ ^ \\ ] + \\ / gi, '$1:\\Users\\<username>\\' )
70
+ // Dedupe temp filenames in errors (from terminal script setup)
71
+ . replace ( / ( [ a - z A - Z ] + ) \d { 12 , } \. t e m p / g, '$1<number>.temp' ) ;
72
+ } ) ;
73
+ }
74
+
75
+ return event ;
59
76
}
60
77
} ) ;
61
78
You can’t perform that action at this time.
0 commit comments