mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
electron-17: refactored code related to crash reporter
This commit is contained in:
parent
d4b30ba148
commit
08b58b51bb
@ -1,47 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const {crashReporter} = require('electron');
|
||||
|
||||
let crashReporterDetails;
|
||||
let crashDirectoryPath;
|
||||
|
||||
/**
|
||||
* Setup the crash reporter with appropriate information
|
||||
* from the global config file
|
||||
* @param detailObj: An object to send extra parameters
|
||||
* via the crash reporter
|
||||
*/
|
||||
function setupCrashReporter(detailObj) {
|
||||
|
||||
// App store builds cannot use crash reporter, so, exit if that's the case
|
||||
if (process.platform === 'darwin' && process.mas) {
|
||||
return
|
||||
}
|
||||
|
||||
if (process.type === 'renderer' && !(process.platform === 'darwin')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If the crash reporter info is empty, exit
|
||||
if (!crashReporterDetails){
|
||||
return
|
||||
}
|
||||
|
||||
let crashReportInfo = crashReporterDetails;
|
||||
crashReportInfo.extra = detailObj;
|
||||
crashReporter.start(crashReportInfo);
|
||||
|
||||
crashDirectoryPath = crashReporter.getCrashesDirectory();
|
||||
}
|
||||
|
||||
function setCrashReporterDetails(crashReporterInfo) {
|
||||
crashReporterDetails = crashReporterInfo;
|
||||
}
|
||||
|
||||
function getCrashDirectoryPath() {
|
||||
return crashDirectoryPath;
|
||||
}
|
||||
|
||||
exports.setupCrashReporter = setupCrashReporter;
|
||||
exports.setCrashReporterDetails = setCrashReporterDetails;
|
||||
exports.getCrashDirectoryPath = getCrashDirectoryPath;
|
@ -32,7 +32,7 @@ require('./memoryMonitor.js');
|
||||
|
||||
const windowMgr = require('./windowMgr.js');
|
||||
|
||||
crashReporter.start({companyName: 'Symphony', uploadToServer: false, submitURL: 'http://localhost:3000/', extra: {'process': 'main'}});
|
||||
crashReporter.start({companyName: 'Symphony', uploadToServer: false, extra: {'process': 'main'}});
|
||||
|
||||
// only allow a single instance of app.
|
||||
const shouldQuit = app.makeSingleInstance((argv) => {
|
||||
|
@ -53,7 +53,7 @@ const throttledSetBadgeCount = throttle(1000, function(count) {
|
||||
});
|
||||
});
|
||||
|
||||
crashReporter.start({companyName: 'Symphony', uploadToServer: false, submitURL: 'http://localhost:3000/', extra: {'process': 'preload script / renderer'}});
|
||||
crashReporter.start({companyName: 'Symphony', uploadToServer: false, extra: {'process': 'preload script / renderer'}});
|
||||
createAPI();
|
||||
|
||||
// creates API exposed from electron.
|
||||
|
@ -93,7 +93,7 @@ function doCreateMainWindow(initialUrl, initialBounds) {
|
||||
let url = initialUrl;
|
||||
let key = getGuid();
|
||||
|
||||
crashReporter.start({companyName: 'Symphony', uploadToServer: false, submitURL: 'http://localhost:3000/', extra: {'process': 'renderer / window manager'}});
|
||||
crashReporter.start({companyName: 'Symphony', uploadToServer: false, extra: {'process': 'renderer / window manager'}});
|
||||
log.send(logLevels.INFO, 'creating main window url: ' + url);
|
||||
|
||||
let newWinOpts = {
|
||||
|
Loading…
Reference in New Issue
Block a user