Skip to content

Commit 76f6410

Browse files
committed
Better log message when no ssh keys found
1 parent 6193209 commit 76f6410

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/remoteConnector.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -714,13 +714,18 @@ export default class RemoteConnector extends Disposable {
714714
await vscode.env.clipboard.writeText(password);
715715
return;
716716
}
717+
718+
const serviceUrl = getServiceURL(sshParams.gitpodHost);
719+
const externalUrl = sshKeysSupported ? `${serviceUrl}/keys` : 'https://www.gitpod.io/docs/configure/ssh#create-an-ssh-key';
717720
if (action === configureSSH) {
718-
const serviceUrl = getServiceURL(sshParams.gitpodHost);
719-
const externalUrl = sshKeysSupported ? `${serviceUrl}/keys` : 'https://www.gitpod.io/docs/configure/ssh#create-an-ssh-key';
720721
await vscode.env.openExternal(vscode.Uri.parse(externalUrl));
721722
throw new Error(`SSH password modal dialog, Configure SSH`);
722723
}
723724

725+
const logMessage = sshKeysSupported
726+
? `Configure your SSH keys in ${externalUrl} and try again. Or try again and select 'Copy' to connect using a temporary password until workspace restart`
727+
: `Create an SSH key (${externalUrl}) and try again. Or try again and select 'Copy' to connect using a temporary password until workspace restart`;
728+
this.logger.info(logMessage);
724729
this.logger.show();
725730
throw new Error('SSH password modal dialog, Canceled');
726731
}
@@ -793,7 +798,7 @@ export default class RemoteConnector extends Disposable {
793798
await this.showSSHPasswordModal(password, params);
794799
}
795800

796-
this.telemetry.sendRawTelemetryEvent('vscode_desktop_ssh', { kind: 'gateway', status: 'connected', ...params, gitpodVersion: gitpodVersion.raw, userOverride });
801+
this.telemetry.sendRawTelemetryEvent('vscode_desktop_ssh', { kind: 'gateway', status: 'connected', ...params, gitpodVersion: gitpodVersion.raw, auth: password ? 'password' : 'key', userOverride });
797802
} catch (e) {
798803
this.telemetry.sendRawTelemetryEvent('vscode_desktop_ssh', { kind: 'gateway', status: 'failed', reason: e.toString(), ...params, gitpodVersion: gitpodVersion.raw, userOverride });
799804
if (e instanceof NoSSHGatewayError) {

0 commit comments

Comments
 (0)