Fix startCrashReporter in error-logger.js

This commit is contained in:
Janosch Maier 2021-11-24 22:42:09 +01:00 committed by Ben Gotow
parent 0586a0aa6f
commit a9b73e0b91
2 changed files with 11 additions and 11 deletions

View file

@ -61,6 +61,7 @@ const setupErrorLogger = (args = {}) => {
inDevMode: args.devMode,
resourcePath: args.resourcePath,
});
errorLogger.startCrashReporter();
process.on('uncaughtException', errorLogger.reportError);
process.on('unhandledRejection', errorLogger.reportError);
return errorLogger;

View file

@ -28,15 +28,14 @@ var RavenErrorReporter = require('./error-logger-extensions/raven-error-reporter
//
// The errorLogger will report errors to a log file as well as to 3rd
// party reporting services if enabled.
module.exports = ErrorLogger = (function() {
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();
@ -101,12 +100,8 @@ module.exports = ErrorLogger = (function() {
console.error(error, extra);
};
/////////////////////////////////////////////////////////////////////
////////////////////////// PRIVATE METHODS //////////////////////////
/////////////////////////////////////////////////////////////////////
ErrorLogger.prototype._startCrashReporter = function(args) {
/* crashReporter.start({
ErrorLogger.prototype.startCrashReporter = function () {
crashReporter.start({
productName: 'Mailspring',
companyName: 'Mailspring',
submitURL: `https://id.getmailspring.com/report-crash?ver=${appVersion}&platform=${process.platform}`,
@ -116,10 +111,14 @@ module.exports = ErrorLogger = (function() {
ver: appVersion,
platform: process.platform,
},
}) */
})
};
ErrorLogger.prototype._extendNativeConsole = function(args) {
/////////////////////////////////////////////////////////////////////
////////////////////////// PRIVATE METHODS //////////////////////////
/////////////////////////////////////////////////////////////////////
ErrorLogger.prototype._extendNativeConsole = function (args) {
console.debug = this._consoleDebug.bind(this);
};