File tree Expand file tree Collapse file tree 3 files changed +133
-66
lines changed Expand file tree Collapse file tree 3 files changed +133
-66
lines changed Original file line number Diff line number Diff line change 109
109
"publish" : null
110
110
},
111
111
"dependencies" : {
112
- "@sentry/electron" : " ^2.4.1" ,
112
+ "@sentry/electron" : " ^2.5.0" ,
113
+ "@sentry/integrations" : " ^6.7.1" ,
113
114
"electron-context-menu" : " ^0.15.1" ,
114
115
"electron-first-run" : " ^3.0.0" ,
115
116
"electron-window-state" : " ^5.0.3" ,
Original file line number Diff line number Diff line change 1
- import * as Sentry from '@sentry/electron ';
1
+ const DEV_MODE = process . env . HTK_DEV === 'true ';
2
2
3
- Sentry . init ( { dsn : 'https://1194b128453942ed9470d49a74c35992@o202389.ingest.sentry.io/1367048' } ) ;
3
+ import * as Sentry from '@sentry/electron' ;
4
+ import { RewriteFrames } from '@sentry/integrations' ;
5
+
6
+ if ( ! DEV_MODE ) {
7
+ Sentry . init ( {
8
+ dsn : 'https://1194b128453942ed9470d49a74c35992@o202389.ingest.sentry.io/1367048' ,
9
+ integrations : [
10
+ new RewriteFrames ( {
11
+ // Make all paths relative to this root, because otherwise it can make
12
+ // errors unnecessarily distinct, especially on Windows.
13
+ root : process . platform === 'win32'
14
+ // Root must always be POSIX format, so we transform it on Windows:
15
+ ? __dirname
16
+ . replace ( / ^ [ A - Z ] : / , '' ) // remove Windows-style prefix
17
+ . replace ( / \\ / g, '/' ) // replace all `\\` instances with `/`
18
+ : __dirname
19
+ } )
20
+ ]
21
+ } ) ;
22
+ }
4
23
5
24
function reportError ( error : Error | string ) {
6
25
console . log ( error ) ;
@@ -43,7 +62,6 @@ const packageJson = require('../package.json');
43
62
44
63
const isWindows = os . platform ( ) === 'win32' ;
45
64
46
- const DEV_MODE = process . env . HTK_DEV === 'true' ;
47
65
const APP_URL = process . env . APP_URL || 'https://app.httptoolkit.tech' ;
48
66
const AUTH_TOKEN = uuid ( ) ;
49
67
const DESKTOP_VERSION = packageJson . version ;
You can’t perform that action at this time.
0 commit comments