Skip to content

Commit

Permalink
Error and dont test protocol when it's not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
timfish committed Nov 5, 2021
1 parent bdd6961 commit a9844fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/main/ipc/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SentryError } from '@sentry/utils';
import { IPCMode } from '../../common';
import { supportsFullProtocol } from '../electron-normalize';
import { ElectronMainOptions } from '../sdk';
Expand All @@ -6,6 +7,10 @@ import { configure as configureProtocol } from './protocol';

/** Sets up communication channels with the renderer */
export function configureIPC(options: ElectronMainOptions): void {
if (!supportsFullProtocol() && options.ipcMode === IPCMode.Protocol) {
throw new SentryError('IPCMode.Protocol is only supported in Electron >= v5');
}

// eslint-disable-next-line no-bitwise
if (supportsFullProtocol() && (options.ipcMode & IPCMode.Protocol) > 0) {
configureProtocol(options);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# JavaScript Renderer Error via Protocol

| Setting | Value |
| ------------- | ---------- |
| Category | JavaScript |
| Build Command | yarn |
| Setting | Value |
| ------------- | ------------------ |
| Category | JavaScript |
| Build Command | yarn |
| Run Condition | version.major >= 5 |

0 comments on commit a9844fe

Please sign in to comment.