diff --git a/app/src/browser/main.js b/app/src/browser/main.js index 9479aeaed..2682102e8 100644 --- a/app/src/browser/main.js +++ b/app/src/browser/main.js @@ -61,7 +61,6 @@ const setupErrorLogger = (args = {}) => { inDevMode: args.devMode, resourcePath: args.resourcePath, }); - errorLogger.startCrashReporter(); process.on('uncaughtException', errorLogger.reportError); process.on('unhandledRejection', errorLogger.reportError); return errorLogger; diff --git a/app/src/error-logger.js b/app/src/error-logger.js index bd1da3c38..7937b758b 100644 --- a/app/src/error-logger.js +++ b/app/src/error-logger.js @@ -10,7 +10,6 @@ if (process.type === 'renderer') { } var appVersion = app.getVersion(); -var crashReporter = require('electron').crashReporter; var RavenErrorReporter = require('./error-logger-extensions/raven-error-reporter'); // A globally available ErrorLogger that can report errors to various @@ -31,11 +30,12 @@ var RavenErrorReporter = require('./error-logger-extensions/raven-error-reporter module.exports = ErrorLogger = (function () { function ErrorLogger(args) { this.reportError = this.reportError.bind(this); - this.startCrashReporter = this.startCrashReporter.bind(this); this.inSpecMode = args.inSpecMode; this.inDevMode = args.inDevMode; this.resourcePath = args.resourcePath; + this._startCrashReporter(); + this._extendErrorObject(); this._extendNativeConsole(); @@ -100,8 +100,15 @@ module.exports = ErrorLogger = (function () { console.error(error, extra); }; - ErrorLogger.prototype.startCrashReporter = function () { - crashReporter.start({ + ///////////////////////////////////////////////////////////////////// + ////////////////////////// PRIVATE METHODS ////////////////////////// + ///////////////////////////////////////////////////////////////////// + + ErrorLogger.prototype._startCrashReporter = function (args) { + if (process.type === 'renderer') { + return; + } + require('electron').crashReporter.start({ productName: 'Mailspring', companyName: 'Mailspring', submitURL: `https://id.getmailspring.com/report-crash?ver=${appVersion}&platform=${process.platform}`, @@ -114,10 +121,6 @@ module.exports = ErrorLogger = (function () { }) }; - ///////////////////////////////////////////////////////////////////// - ////////////////////////// PRIVATE METHODS ////////////////////////// - ///////////////////////////////////////////////////////////////////// - ErrorLogger.prototype._extendNativeConsole = function (args) { console.debug = this._consoleDebug.bind(this); };