Skip to content

Commit 20df47a

Browse files
committed
Report GOAWAY error
1 parent e527e8d commit 20df47a

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export async function activate(context: vscode.ExtensionContext) {
7878
const hostService = new HostService(context, notificationService, logger);
7979
context.subscriptions.push(hostService);
8080

81-
const sessionService = new SessionService(hostService, logger);
81+
const sessionService = new SessionService(hostService, logger, telemetryService);
8282
context.subscriptions.push(sessionService);
8383

8484
const remoteService = new RemoteService(context, hostService, telemetryService, sessionService, logger);

src/publicApi.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { timeout } from './common/async';
1616
import { MetricsReporter, getConnectMetricsInterceptor } from './metrics';
1717
import { ILogService } from './services/logService';
1818
import { WrapError } from './common/utils';
19+
import { ITelemetryService } from './common/telemetry';
1920

2021
function isTelemetryEnabled(): boolean {
2122
const TELEMETRY_CONFIG_ID = 'telemetry';
@@ -52,7 +53,12 @@ export class GitpodPublicApi extends Disposable implements IGitpodAPI {
5253

5354
private workspaceStatusStreamMap = new Map<string, { onStatusChanged: vscode.Event<WorkspaceStatus>; dispose: (force?: boolean) => void; increment: () => void }>();
5455

55-
constructor(private accessToken: string, private gitpodHost: string, private logger: ILogService) {
56+
constructor(
57+
private readonly accessToken: string,
58+
private readonly gitpodHost: string,
59+
private readonly logger: ILogService,
60+
private readonly telemetryService: ITelemetryService
61+
) {
5662
super();
5763

5864
this.createClients();
@@ -201,6 +207,7 @@ export class GitpodPublicApi extends Disposable implements IGitpodAPI {
201207
// Remove this once it's fixed upstream
202208
const message: string = e.stack || e.message || `${e}`;
203209
if (message.includes('New streams cannot be created after receiving a GOAWAY')) {
210+
this.telemetryService.sendTelemetryException(e);
204211
this.logger.error('Got GOAWAY bug, recreating connect client');
205212
this.createClients();
206213
}
@@ -236,6 +243,7 @@ export class GitpodPublicApi extends Disposable implements IGitpodAPI {
236243
// Remove this once it's fixed upstream
237244
const message: string = e.stack || e.message || `${e}`;
238245
if (message.includes('New streams cannot be created after receiving a GOAWAY')) {
246+
this.telemetryService.sendTelemetryException(e);
239247
this.logger.error('Got GOAWAY bug, recreating connect client');
240248
this.createClients();
241249

src/services/sessionService.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { IHostService } from './hostService';
99
import { GitpodPublicApi, IGitpodAPI } from '../publicApi';
1010
import { eventToPromise } from '../common/event';
1111
import { ILogService } from './logService';
12+
import { ITelemetryService } from '../common/telemetry';
1213

1314
export class NoSignedInError extends Error {
1415
constructor() {
@@ -56,7 +57,8 @@ export class SessionService extends Disposable implements ISessionService {
5657

5758
constructor(
5859
private readonly hostService: IHostService,
59-
private readonly logger: ILogService
60+
private readonly logger: ILogService,
61+
private readonly telemetryService: ITelemetryService
6062
) {
6163
super();
6264

@@ -168,7 +170,7 @@ export class SessionService extends Disposable implements ISessionService {
168170
throw new NoSignedInError();
169171
}
170172
if (!this._publicApi) {
171-
this._publicApi = new GitpodPublicApi(this.getGitpodToken(), this.hostService.gitpodHost, this.logger);
173+
this._publicApi = new GitpodPublicApi(this.getGitpodToken(), this.hostService.gitpodHost, this.logger, this.telemetryService);
172174
}
173175
return this._publicApi;
174176
}

0 commit comments

Comments
 (0)