Skip to content

Commit 7299cd5

Browse files
abhigyankakashnimare
authored andcommitted
sentry: Initialize sentry for main and renderer process using logger-util.
captureExceptions are used to report expected exceptions from domain-util.js and config-util.js. All files that include logger-util automatically includes sentry for those files and report unexpected exceptions to sentry.
1 parent a45254c commit 7299cd5

File tree

8 files changed

+272
-8
lines changed

8 files changed

+272
-8
lines changed

app/main/crash-reporter.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
'use strict';
22

3-
const { crashReporter } = require('electron');
3+
// const { crashReporter } = require('electron');
44

5+
// Temporarily remove this.
56
const crashHandler = () => {
6-
crashReporter.start({
7-
productName: 'zulip-electron',
8-
companyName: 'Kandra Labs, Inc.',
9-
submitURL: 'https://zulip-sentry.herokuapp.com/crashreport',
10-
uploadToServer: true
11-
});
7+
// crashReporter.start({
8+
// productName: 'zulip-electron',
9+
// companyName: 'Kandra Labs, Inc.',
10+
// submitURL: 'https://zulip-sentry.herokuapp.com/crashreport',
11+
// uploadToServer: true
12+
// });
1213
};
1314

1415
module.exports = {

app/main/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const { app, ipcMain } = electron;
1414
const BadgeSettings = require('./../renderer/js/pages/preference/badge-settings.js');
1515
const ConfigUtil = require('./../renderer/js/utils/config-util.js');
1616
const ProxyUtil = require('./../renderer/js/utils/proxy-util.js');
17+
const { sentryInit } = require('./../renderer/js/utils/sentry-util.js');
1718

1819
// Adds debug features like hotkeys for triggering dev tools and reload
1920
// in development mode
@@ -155,6 +156,9 @@ app.on('ready', () => {
155156
});
156157
mainWindow = createMainWindow();
157158

159+
// Initialize sentry for main process
160+
sentryInit();
161+
158162
const isSystemProxy = ConfigUtil.getConfigItem('useSystemProxy');
159163

160164
if (isSystemProxy) {

0 commit comments

Comments
 (0)