File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
packages/core/src/shared/extensions Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,15 @@ export class RemoteSshSettings extends Settings.define('remote.SSH', remoteSshTy
130130 }
131131}
132132
133+ /**
134+ * Test a SSH connection over SSM.
135+ * @param ProcessClass given process to test the connection within.
136+ * @param hostname
137+ * @param sshPath
138+ * @param user
139+ * @param session SSM session credentials. These cannot be reused, so it may be required to create a seperate session for the test connection.
140+ * @returns
141+ */
133142export async function testSshConnection (
134143 ProcessClass : typeof ChildProcess ,
135144 hostname : string ,
@@ -146,8 +155,9 @@ export async function testSshConnection(
146155 } ,
147156 } )
148157 } catch ( error ) {
149- const errorMessage = [ process . result ( ) ?. stderr ?? '' ] . join ( '\n' )
150- throw new SshError ( errorMessage , { cause : error as Error } )
158+ throw new SshError ( process . result ( ) ?. stderr ?? 'An unknown error occurred when testing the connection' , {
159+ cause : error as Error ,
160+ } )
151161 }
152162}
153163
You can’t perform that action at this time.
0 commit comments