Skip to content

Commit 4059333

Browse files
fix: remove uncaughtException listner (#472)
* fix: remove uncaughtException listner / refactor messages file to match command name * chore: update error handling to not overwrite our errors * chore: remove try/catch
1 parent ba88590 commit 4059333

File tree

3 files changed

+1
-12
lines changed

3 files changed

+1
-12
lines changed
File renamed without changes.

src/commands/apex/get/test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { RunResult, TestReporter } from '../../../reporters/index.js';
1919
import { resultFormat } from '../../../utils.js';
2020

2121
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
22-
const messages = Messages.loadMessages('@salesforce/plugin-apex', 'report');
22+
const messages = Messages.loadMessages('@salesforce/plugin-apex', 'gettest');
2323
export default class Test extends SfCommand<RunResult> {
2424
public static readonly summary = messages.getMessage('summary');
2525
public static readonly description = messages.getMessage('description');
@@ -65,11 +65,6 @@ export default class Test extends SfCommand<RunResult> {
6565
public async run(): Promise<RunResult> {
6666
const { flags } = await this.parse(Test);
6767

68-
// add listener for errors
69-
process.on('uncaughtException', (err) => {
70-
throw messages.createError('apexLibErr', [err.message]);
71-
});
72-
7368
const conn = flags['target-org'].getConnection(flags['api-version']);
7469

7570
const testService = new TestService(conn);

src/commands/apex/run/test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
} from '@salesforce/sf-plugins-core';
1818
import { Messages, SfError } from '@salesforce/core';
1919
import { Duration } from '@salesforce/kit';
20-
2120
import { RunResult, TestReporter } from '../../../reporters/index.js';
2221
import { resultFormat } from '../../../utils.js';
2322

@@ -122,11 +121,6 @@ export default class Test extends SfCommand<RunCommandResult> {
122121
flags['test-level'] as TestLevel
123122
);
124123

125-
// add listener for errors
126-
process.on('uncaughtException', (err) => {
127-
throw messages.createError('apexLibErr', [err.message]);
128-
});
129-
130124
// graceful shutdown
131125
const exitHandler = async (): Promise<void> => {
132126
await this.cancellationTokenSource.asyncCancel();

0 commit comments

Comments
 (0)