@@ -8,10 +8,10 @@ var RAVEN_C = '243594'
88var MAIN_THREAD = 'browser'
99var RENDERER = 'renderer'
1010
11- function getopts ( processtype , name ) {
11+ function getopts ( processtype ) {
1212 return {
1313 captureUnhandledRejections : true ,
14- name : name || 'Hyperamp' ,
14+ name : 'Hyperamp' ,
1515 release : require ( './package.json' ) . version ,
1616 extra : {
1717 platform : os . platform ( ) ,
@@ -26,37 +26,34 @@ function getopts (processtype, name) {
2626 }
2727}
2828
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 } `
3433
35- if ( process . type === MAIN_THREAD ) {
34+ if ( process . type === MAIN_THREAD ) {
3635 // 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
3938
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.
4342
4443If you are connected to the internet, this has been reported anonymously to the project maintainers - they will work on a fix.
4544
4645The app may now quit - you can safely reopen it.` ,
47- detail : err . stack ,
48- buttons : [ 'OK' ]
49- } )
46+ detail : err . stack ,
47+ buttons : [ 'OK' ]
5048 } )
51- }
49+ } )
50+ }
5251
53- if ( process . type === RENDERER ) {
52+ if ( process . type === RENDERER ) {
5453 // Renderer stuff only
55- }
56-
57- var sentry = raven . config ( url , getopts ( process . type ) , name ) . install ( )
58- console . log ( 'Sentry installed' )
59- return sentry
6054}
6155
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