Skip to content

Commit

Permalink
ignore normal exit when reporting API process close (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebdoxsey authored Jan 2, 2025
1 parent 5c9fe2f commit 3e84d2d
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 249 deletions.
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

0 comments on commit 3e84d2d

Please sign in to comment.