Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore normal exit when reporting API process close #431

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ node_modules
release
src/main.prod.js
src/main.prod.js.map
src/main.prod.js.LICENSE.txt
src/renderer.prod.js
src/renderer.prod.js.map
src/style.css
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
"webpack": "^5.94.0",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "^5.1.0",
"webpack-dev-server": "^4.15.2",
"webpack-merge": "^5.10.0",
"yarn-deduplicate": "^6.0.2"
},
Expand Down
14 changes: 9 additions & 5 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ChildProcessWithoutNullStreams, spawn } from 'child_process';
import * as Sentry from '@sentry/electron';
import * as Sentry from '@sentry/electron/main';
import { ChannelCredentials } from '@grpc/grpc-js';
import { createServer } from 'net';

Expand Down Expand Up @@ -39,10 +39,14 @@ export async function start(sentryDSN: string): Promise<CLI> {
});
process.on('close', (code, signal) => {
if (signal != null) return;
Sentry.captureEvent({
message: 'API process unexpectedly quit',
extra: { code },
});
if ((code || 0) > 0) {
// code == -2 when the child process didn't start at all,
// code == 0 when we close the child process
Sentry.captureEvent({
message: 'API process unexpectedly quit',
extra: { code },
});
}
});

const configClient = new ConfigClient(
Expand Down
2 changes: 1 addition & 1 deletion src/main.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
MessageBoxOptions,
} from 'electron';
import * as grpc from '@grpc/grpc-js';
import * as Sentry from '@sentry/electron';
import * as Sentry from '@sentry/electron/main';
import log from 'electron-log';
import { autoUpdater } from 'electron-updater';
import { menubar } from 'menubar';
Expand Down
50 changes: 0 additions & 50 deletions src/main.prod.js.LICENSE.txt

This file was deleted.

2 changes: 1 addition & 1 deletion src/renderer/window.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Sentry from '@sentry/electron';
import * as Sentry from '@sentry/electron/main';
import { BrowserWindow } from 'electron';
import { getAssetPath } from '../main/binaries';
import MenuBuilder from './menu';
Expand Down
Loading
Loading