Browse Source
Merge pull request #814 from gre/report-internal-crash
Report internal crashes
master
Gaëtan Renaudeau
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
15 additions and
1 deletions
-
src/internals/index.js
-
src/main/bridge.js
|
|
@ -11,6 +11,14 @@ require('../env') |
|
|
|
|
|
|
|
process.title = 'Internal' |
|
|
|
|
|
|
|
process.on('uncaughtException', err => { |
|
|
|
process.send({ |
|
|
|
type: 'uncaughtException', |
|
|
|
error: serializeError(err), |
|
|
|
}) |
|
|
|
process.exit(1) |
|
|
|
}) |
|
|
|
|
|
|
|
const defers = {} |
|
|
|
|
|
|
|
let sentryEnabled = process.env.INITIAL_SENTRY_ENABLED || false |
|
|
|
|
|
@ -7,8 +7,9 @@ import { ipcMain, app } from 'electron' |
|
|
|
import { ipcMainListenReceiveCommands } from 'helpers/ipc' |
|
|
|
import path from 'path' |
|
|
|
import logger from 'logger' |
|
|
|
import sentry from 'sentry/node' |
|
|
|
import sentry, { captureException } from 'sentry/node' |
|
|
|
import user from 'helpers/user' |
|
|
|
import { deserializeError } from 'helpers/errors' |
|
|
|
|
|
|
|
import setupAutoUpdater, { quitAndInstall } from './autoUpdate' |
|
|
|
import { setInternalProcessPID } from './terminator' |
|
|
@ -100,6 +101,11 @@ ipcMainListenReceiveCommands({ |
|
|
|
|
|
|
|
function handleGlobalInternalMessage(payload) { |
|
|
|
switch (payload.type) { |
|
|
|
case 'uncaughtException': { |
|
|
|
const err = deserializeError(payload.error) |
|
|
|
captureException(err) |
|
|
|
break |
|
|
|
} |
|
|
|
case 'setLibcoreBusy': |
|
|
|
case 'setDeviceBusy': |
|
|
|
case 'executeHttpQueryOnRenderer': { |
|
|
|