Skip to content

Commit 68ac569

Browse files
committed
Fix ssh failed reason mapping
1 parent 224b976 commit 68ac569

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/local-ssh/proxy.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const exitProcess = async (forceExit: boolean, signal?: NodeJS.Signals) => {
7171
};
7272

7373
import { SshClient } from '@microsoft/dev-tunnels-ssh-tcp';
74-
import { NodeStream, ObjectDisposedError, SshChannelError, SshClientCredentials, SshClientSession, SshConnectionError, SshDisconnectReason, SshReconnectError, SshServerSession, SshSessionConfiguration, Stream, WebSocketStream } from '@microsoft/dev-tunnels-ssh';
74+
import { NodeStream, ObjectDisposedError, SshChannelError, SshChannelOpenFailureReason, SshClientCredentials, SshClientSession, SshConnectionError, SshDisconnectReason, SshReconnectError, SshReconnectFailureReason, SshServerSession, SshSessionConfiguration, Stream, WebSocketStream } from '@microsoft/dev-tunnels-ssh';
7575
import { importKey, importKeyBytes } from '@microsoft/dev-tunnels-ssh-keys';
7676
import { ExtensionServiceDefinition, GetWorkspaceAuthInfoResponse } from '../proto/typescript/ipc/v1/ipc';
7777
import { Client, ClientError, Status, createChannel, createClient } from 'nice-grpc';
@@ -386,10 +386,10 @@ function fixSSHErrorName(err: any) {
386386
err.message = `[${SshDisconnectReason[err.reason ?? SshDisconnectReason.none]}] ${err.message}`;
387387
} else if (err instanceof SshReconnectError) {
388388
err.name = 'SshReconnectError';
389-
err.message = `[${SshDisconnectReason[err.reason ?? SshDisconnectReason.none]}] ${err.message}`;
389+
err.message = `[${SshReconnectFailureReason[err.reason ?? SshReconnectFailureReason.none]}] ${err.message}`;
390390
} else if (err instanceof SshChannelError) {
391391
err.name = 'SshChannelError';
392-
err.message = `[${SshDisconnectReason[err.reason ?? SshDisconnectReason.none]}] ${err.message}`;
392+
err.message = `[${SshChannelOpenFailureReason[err.reason ?? SshChannelOpenFailureReason.none]}] ${err.message}`;
393393
} else if (err instanceof ObjectDisposedError) {
394394
err.name = 'ObjectDisposedError';
395395
}
@@ -400,9 +400,9 @@ function getFailureCode(err: any) {
400400
if (err instanceof SshConnectionError) {
401401
return `SshConnectionError.${SshDisconnectReason[err.reason ?? SshDisconnectReason.none]}`;
402402
} else if (err instanceof SshReconnectError) {
403-
return `SshReconnectError.${SshDisconnectReason[err.reason ?? SshDisconnectReason.none]}`;
403+
return `SshReconnectError.${SshReconnectFailureReason[err.reason ?? SshReconnectFailureReason.none]}`;
404404
} else if (err instanceof SshChannelError) {
405-
return `SshChannelError.${SshDisconnectReason[err.reason ?? SshDisconnectReason.none]}`;
405+
return `SshChannelError.${SshChannelOpenFailureReason[err.reason ?? SshChannelOpenFailureReason.none]}`;
406406
} else if (err instanceof ObjectDisposedError) {
407407
return 'ObjectDisposedError';
408408
} else if (err instanceof FailedToProxyError) {

0 commit comments

Comments
 (0)