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() {
5656 }
5757 }
5858 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 ;
5976 }
6077 } ) ;
6178
You can’t perform that action at this time.
0 commit comments