@@ -8,10 +8,10 @@ var RAVEN_C = '243594'
8
8
var MAIN_THREAD = 'browser'
9
9
var RENDERER = 'renderer'
10
10
11
- function getopts ( processtype , name ) {
11
+ function getopts ( processtype ) {
12
12
return {
13
13
captureUnhandledRejections : true ,
14
- name : name || 'Hyperamp' ,
14
+ name : 'Hyperamp' ,
15
15
release : require ( './package.json' ) . version ,
16
16
extra : {
17
17
platform : os . platform ( ) ,
@@ -26,37 +26,34 @@ function getopts (processtype, name) {
26
26
}
27
27
}
28
28
29
- function setup ( name ) {
30
- // process.type === 'browser' : main thread
31
- // process.type === 'renderer' : electron window
32
- var raven = process . type === MAIN_THREAD ? require ( 'raven' ) : require ( 'raven-js' )
33
- var url = process . type === MAIN_THREAD ? `https://${ RAVEN_A } :${ RAVEN_B } @sentry.io/${ RAVEN_C } ` : `https://${ RAVEN_A } @sentry.io/${ RAVEN_C } `
29
+ // process.type === 'browser' : main thread
30
+ // process.type === 'renderer' : electron window
31
+ var raven = process . type === MAIN_THREAD ? require ( 'raven' ) : require ( 'raven-js' )
32
+ var url = process . type === MAIN_THREAD ? `https://${ RAVEN_A } :${ RAVEN_B } @sentry.io/${ RAVEN_C } ` : `https://${ RAVEN_A } @sentry.io/${ RAVEN_C } `
34
33
35
- if ( process . type === MAIN_THREAD ) {
34
+ if ( process . type === MAIN_THREAD ) {
36
35
// Main thread stuff only
37
- process . on ( 'uncaughtException' , ( err ) => {
38
- const dialog = require ( 'electron' ) . dialog
36
+ process . on ( 'uncaughtException' , ( err ) => {
37
+ const dialog = require ( 'electron' ) . dialog
39
38
40
- dialog . showMessageBox ( {
41
- title : 'An error occurred' ,
42
- message : `Sorry for the trouble, but an error has occurred in Hyperamp and we don't know how to recover from it.
39
+ dialog . showMessageBox ( {
40
+ title : 'An error occurred' ,
41
+ message : `Sorry for the trouble, but an error has occurred in Hyperamp and we don't know how to recover from it.
43
42
44
43
If you are connected to the internet, this has been reported anonymously to the project maintainers - they will work on a fix.
45
44
46
45
The app may now quit - you can safely reopen it.` ,
47
- detail : err . stack ,
48
- buttons : [ 'OK' ]
49
- } )
46
+ detail : err . stack ,
47
+ buttons : [ 'OK' ]
50
48
} )
51
- }
49
+ } )
50
+ }
52
51
53
- if ( process . type === RENDERER ) {
52
+ if ( process . type === RENDERER ) {
54
53
// Renderer stuff only
55
- }
56
-
57
- var sentry = raven . config ( url , getopts ( process . type ) , name ) . install ( )
58
- console . log ( 'Sentry installed' )
59
- return sentry
60
54
}
61
55
62
- module . exports = setup
56
+ var sentry = raven . config ( url , getopts ( process . type ) ) . install ( )
57
+ console . log ( 'Sentry installed' )
58
+
59
+ module . exports = sentry
0 commit comments