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

Add try-catch around call that throws in ctor #155224

Merged
merged 1 commit into from Jul 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/vs/workbench/api/browser/mainThreadTesting.ts
Expand Up @@ -19,6 +19,7 @@ import { ITestResultService } from 'vs/workbench/contrib/testing/common/testResu
import { IMainThreadTestController, ITestRootProvider, ITestService } from 'vs/workbench/contrib/testing/common/testService';
import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers';
import { ExtHostContext, ExtHostTestingShape, ILocationDto, ITestControllerPatch, MainContext, MainThreadTestingShape } from '../common/extHost.protocol';
import { onUnexpectedError } from 'vs/base/common/errors';

@extHostNamedCustomer(MainContext.MainThreadTesting)
export class MainThreadTesting extends Disposable implements MainThreadTestingShape, ITestRootProvider {
Expand All @@ -42,7 +43,13 @@ export class MainThreadTesting extends Disposable implements MainThreadTestingSh

const prevResults = resultService.results.map(r => r.toJSON()).filter(isDefined);
if (prevResults.length) {
this.proxy.$publishTestResults(prevResults);
try {
this.proxy.$publishTestResults(prevResults);
} catch (err) {
// See https://github.com/microsoft/vscode/issues/151147
// Trying to send more than 1GB of data can cause the method to throw.
onUnexpectedError(err);
}
}

this._register(this.testService.onDidCancelTestRun(({ runId }) => {
Expand Down